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 that user 'admin', on blanket approving a new Role maintenance document, results in a final document
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029 public class IdentityRoleBlanketAppIT extends UpgradedSeleniumITBase {
030 @Override
031 public String getTestUrl() {
032 return PORTAL;
033 }
034
035 @Test
036 public void testRole() throws Exception {
037 assertEquals("Kuali Portal Index", selenium.getTitle());
038 selenium.click("link=Administration");
039 selenium.waitForPageToLoad("30000");
040 assertEquals("Kuali Portal Index", selenium.getTitle());
041 selenium.click("link=Role");
042 selenium.waitForPageToLoad("30000");
043 assertEquals("Kuali Portal Index", selenium.getTitle());
044 selenium.selectFrame("iframeportlet");
045 selenium.click("//img[@alt='create new']");
046 selenium.waitForPageToLoad("30000");
047 selenium.click("//input[@name='methodToCall.search' and @value='search']");
048 selenium.waitForPageToLoad("30000");
049 selenium.click("link=return value");
050 selenium.waitForPageToLoad("30000");
051 String docId = selenium.getText("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]");
052 selenium.type("//input[@id='document.documentHeader.documentDescription']", "Validation Test Role");
053 selenium.select("//select[@id='document.roleNamespace']", IdentityResponsibilityBlanketAppIT.LABEL_KUALI_KUALI_SYSTEMS);
054 selenium.waitForPageToLoad("30000");
055 selenium.type("//input[@id='document.roleName']", "Validation Test Role4");
056 selenium.click("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
057 selenium.waitForPageToLoad("30000");
058 selenium.click("//input[@name='methodToCall.search' and @value='search']");
059 selenium.waitForPageToLoad("30000");
060 selenium.click("link=return value");
061 selenium.waitForPageToLoad("30000");
062 selenium.click("methodToCall.addMember.anchorAssignees");
063 selenium.waitForPageToLoad("30000");
064 selenium.click("methodToCall.blanketApprove");
065 selenium.waitForPageToLoad("30000");
066 selenium.selectWindow("null");
067 selenium.click("//img[@alt='doc search']");
068 selenium.waitForPageToLoad("30000");
069 assertEquals("Kuali Portal Index", selenium.getTitle());
070 selenium.selectFrame("iframeportlet");
071 selenium.click("//input[@name='methodToCall.search' and @value='search']");
072 selenium.waitForPageToLoad("30000");
073 docId= "link=" + docId;
074 assertTrue(selenium.isElementPresent(docId));
075 if(selenium.isElementPresent(docId)){
076 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
077 }else{
078 assertEquals(docId, selenium.getText("//table[@id='row']/tbody/tr[1]/td[1]"));
079 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
080 }
081 }
082 }