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 Responsibility maintenance document, results in a final document
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029 public class IdentityResponsibilityBlanketAppIT extends UpgradedSeleniumITBase {
030
031 public static final String LABEL_KUALI_KUALI_SYSTEMS = "label=KUALI - Kuali Systems";
032
033 @Override
034 public String getTestUrl() {
035 return PORTAL;
036 }
037
038 @Test
039 public void testResponsibility() 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=Responsibility");
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 String docId = selenium.getText("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]");
051 selenium.type("//input[@id='document.documentHeader.documentDescription']", "Validation Test Responsibility");
052 selenium.select("//select[@id='document.newMaintainableObject.namespaceCode']", LABEL_KUALI_KUALI_SYSTEMS);
053 selenium.type("//input[@id='document.newMaintainableObject.name']", "Validation Test Responsibility1");
054 selenium.type("//input[@id='document.newMaintainableObject.documentTypeName']", "Test");
055 selenium.type("//input[@id='document.newMaintainableObject.routeNodeName']", "Test");
056 selenium.click("//input[@id='document.newMaintainableObject.actionDetailsAtRoleMemberLevel']");
057 selenium.click("//input[@id='document.newMaintainableObject.required']");
058 selenium.click("methodToCall.blanketApprove");
059 selenium.waitForPageToLoad("30000");
060 selenium.selectWindow("null");
061 selenium.click("//img[@alt='doc search']");
062 selenium.waitForPageToLoad("30000");
063 assertEquals("Kuali Portal Index", selenium.getTitle());
064 selenium.selectFrame("iframeportlet");
065 selenium.click("//input[@name='methodToCall.search' and @value='search']");
066 selenium.waitForPageToLoad("30000");
067 docId= "link=" + docId;
068 assertTrue(selenium.isElementPresent(docId));
069 if(selenium.isElementPresent(docId)){
070 assertEquals("ENROUTE", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
071 }else{
072 assertEquals(docId, selenium.getText("//table[@id='row']/tbody/tr[1]/td[1]"));
073 assertEquals("ENROUTE", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
074 }
075 }
076 }