001    /*
002     * Copyright 2011 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl1.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package edu.samplu.admin.test;
017    import static org.junit.Assert.assertEquals;
018    import static org.junit.Assert.assertTrue;
019    
020    import org.junit.After;
021    import org.junit.Before;
022    import org.junit.Test;
023    
024    import com.thoughtworks.selenium.DefaultSelenium;
025    import com.thoughtworks.selenium.Selenium;
026    
027    
028    /**
029     * TODO Administrator don't forget to fill this in. 
030     * 
031     * @author Kuali Rice Team (rice.collab@kuali.org)
032     */
033    public class IdentityGroupIT {
034        private Selenium selenium;
035        @Before
036        public void setUp() throws Exception {
037            selenium = new DefaultSelenium("localhost", 4444, "*firefox", System.getProperty("remote.public.url"));
038            selenium.start();
039        }
040    
041        @Test
042        public void testCreateNew() throws Exception {
043            selenium.open(System.getProperty("remote.public.url"));
044            assertEquals("Login", selenium.getTitle());
045            selenium.type("__login_user", "admin");
046            selenium.click("//input[@value='Login']");
047            selenium.waitForPageToLoad("30000");
048            assertEquals("Kuali Portal Index", selenium.getTitle());
049            selenium.click("link=Administration");
050            selenium.waitForPageToLoad("30000");
051            assertEquals("Kuali Portal Index", selenium.getTitle());
052            selenium.click("link=Group");
053            selenium.waitForPageToLoad("30000");
054            assertEquals("Kuali Portal Index", selenium.getTitle());
055            selenium.selectFrame("iframeportlet");
056            selenium.click("//img[@alt='create new']");        
057            selenium.selectFrame("relative=up");        
058            selenium.waitForPageToLoad("30000");
059            assertTrue(selenium.isElementPresent("methodToCall.cancel"));
060            selenium.click("methodToCall.cancel");
061            selenium.waitForPageToLoad("30000");
062            selenium.click("methodToCall.processAnswer.button0");
063            selenium.waitForPageToLoad("30000");
064        }
065     
066        
067        @Test
068        public void testEditGroup() throws Exception {
069            selenium.open(System.getProperty("remote.public.url"));
070            assertEquals("Login", selenium.getTitle());
071            selenium.type("__login_user", "admin");
072            selenium.click("//input[@value='Login']");
073            selenium.waitForPageToLoad("30000");
074            assertEquals("Kuali Portal Index", selenium.getTitle());
075            selenium.click("link=Administration");
076            selenium.waitForPageToLoad("30000");
077            assertEquals("Kuali Portal Index", selenium.getTitle());
078            selenium.click("link=Group");
079            selenium.waitForPageToLoad("30000");
080            assertEquals("Kuali Portal Index", selenium.getTitle());
081            selenium.selectFrame("iframeportlet");
082            selenium.click("//input[@name='methodToCall.search' and @value='search']");
083            selenium.waitForPageToLoad("30000");
084            selenium.click("link=edit");
085            selenium.waitForPageToLoad("30000");
086            assertTrue(selenium.isElementPresent("methodToCall.cancel"));
087            selenium.click("methodToCall.cancel");
088            selenium.waitForPageToLoad("30000");
089            selenium.click("methodToCall.processAnswer.button0");
090            selenium.waitForPageToLoad("30000");
091        }
092        
093        
094        @After
095        public void tearDown() throws Exception {
096            selenium.stop();
097        }
098    }