001 /**
002 * Copyright 2005-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/ecl2.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
018 import static org.junit.Assert.assertEquals;
019 import static org.junit.Assert.assertTrue;
020
021 import edu.samplu.common.UpgradedSeleniumITBase;
022 import org.junit.Test;
023
024 /**
025 * tests creating and cancelling new and edit Role maintenance screens
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029 public class IdentityRoleIT extends UpgradedSeleniumITBase{
030 @Override
031 public String getTestUrl() {
032 return PORTAL;
033 }
034
035 @Test
036 /**
037 * tests that a new Role maintenance document can be cancelled
038 */
039 public void testCreateNew() throws Exception {
040 assertEquals("Kuali Portal Index", selenium.getTitle());
041 selenium.click("link=Administration");
042 selenium.waitForPageToLoad("30000");
043 assertEquals("Kuali Portal Index", selenium.getTitle());
044 selenium.click("link=Role");
045 selenium.waitForPageToLoad("30000");
046 assertEquals("Kuali Portal Index", selenium.getTitle());
047 selenium.selectFrame("iframeportlet");
048 selenium.click("//img[@alt='create new']");
049 selenium.waitForPageToLoad("30000");
050 selenium.click("//input[@name='methodToCall.search' and @value='search']");
051 selenium.waitForPageToLoad("30000");
052 selenium.click("link=return value");
053 selenium.waitForPageToLoad("30000");
054 assertTrue(selenium.isElementPresent("methodToCall.cancel"));
055 selenium.click("methodToCall.cancel");
056 selenium.waitForPageToLoad("30000");
057 selenium.click("methodToCall.processAnswer.button0");
058 selenium.waitForPageToLoad("30000");
059 }
060
061 @Test
062 /**
063 * tests that a Role maintenance document is created for an edit operation originating from a lookup screen
064 */
065 public void testEditRole() throws Exception {
066 assertEquals("Kuali Portal Index", selenium.getTitle());
067 selenium.click("link=Administration");
068 selenium.waitForPageToLoad("30000");
069 assertEquals("Kuali Portal Index", selenium.getTitle());
070 selenium.click("link=Role");
071 selenium.waitForPageToLoad("30000");
072 assertEquals("Kuali Portal Index", selenium.getTitle());
073 selenium.selectFrame("iframeportlet");
074 selenium.click("//input[@name='methodToCall.search' and @value='search']");
075 selenium.waitForPageToLoad("30000");
076 selenium.click("link=edit");
077 selenium.waitForPageToLoad("30000");
078 assertTrue(selenium.isElementPresent("methodToCall.cancel"));
079 selenium.click("methodToCall.cancel");
080 selenium.waitForPageToLoad("30000");
081 selenium.click("methodToCall.processAnswer.button0");
082 selenium.waitForPageToLoad("30000");
083 }
084 }