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.mainmenu.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 Routing Rule maintenance document, results in a final document
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029 public class WorkFlowRouteRulesBlanketAppIT extends UpgradedSeleniumITBase {
030 @Override
031 public String getTestUrl() {
032 return PORTAL;
033 }
034
035 @Test
036 public void testUntitled() throws Exception {
037 String remotePublicUrl = getBaseUrlString();
038 assertEquals("Kuali Portal Index", selenium.getTitle());
039 selenium.click("link=Routing Rules");
040 selenium.waitForPageToLoad("30000");
041 assertEquals("Kuali Portal Index", selenium.getTitle());
042 selenium.selectFrame("iframeportlet");
043 selenium.click("//img[@alt='create new']");
044 selenium.waitForPageToLoad("30000");
045 selenium.click("methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:documentTypeName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
046 selenium.waitForPageToLoad("30000");
047 selenium.type("name", "RoutingRuleDocument");
048 selenium.click("//input[@name='methodToCall.search' and @value='search']");
049 selenium.waitForPageToLoad("30000");
050 selenium.click("link=return value");
051 selenium.waitForPageToLoad("30000");
052 selenium.click("methodToCall.performLookup.(!!org.kuali.rice.kew.rule.bo.RuleTemplateBo!!).(((name:ruleTemplateName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
053 selenium.waitForPageToLoad("30000");
054 selenium.type("name", "RuleRoutingTemplate");
055 selenium.click("//input[@name='methodToCall.search' and @value='search']");
056 selenium.waitForPageToLoad("30000");
057 selenium.click("link=return value");
058 selenium.waitForPageToLoad("30000");
059 selenium.click("methodToCall.createRule");
060 selenium.waitForPageToLoad("30000");
061 String docId = selenium.getText("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]");
062 assertTrue(selenium.isElementPresent("methodToCall.cancel"));
063 selenium.type("//input[@id='document.documentHeader.documentDescription']", "Test Routing Rule");
064 selenium.click("//input[@id='document.newMaintainableObject.forceAction']");
065 selenium.type("//textarea[@id='document.newMaintainableObject.description']", "Test Routing Rule1");
066 selenium.type("//input[@id='document.newMaintainableObject.fieldValues(1321:docTypeFullName)']", "DocumentTypeDocument");
067 selenium.click("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalName:document.newMaintainableObject.add.personResponsibilities.principalName,))).((`document.newMaintainableObject.add.personResponsibilities.principalName:principalName,`)).((<>)).(([])).((**)).((^^)).((&&)).((/personImpl/)).((~~)).(::::;" + remotePublicUrl + "/kr/lookup.do;::::).anchor15");
068 selenium.waitForPageToLoad("30000");
069 selenium.click("//input[@name='methodToCall.search' and @value='search']");
070 selenium.waitForPageToLoad("30000");
071 selenium.click("link=return value");
072 selenium.waitForPageToLoad("30000");
073 selenium.select("//select[@id='document.newMaintainableObject.add.personResponsibilities.actionRequestedCd']", "label=ACKNOWLEDGE");
074 selenium.type("//input[@id='document.newMaintainableObject.add.personResponsibilities.priority']", "1");
075 selenium.click("methodToCall.addLine.personResponsibilities.(!!org.kuali.rice.kew.rule.PersonRuleResponsibility!!)");
076 selenium.waitForPageToLoad("30000");
077 selenium.click("methodToCall.blanketApprove");
078 selenium.waitForPageToLoad("30000");
079 selenium.selectWindow("null");
080 selenium.click("//img[@alt='doc search']");
081 selenium.waitForPageToLoad("30000");
082 assertEquals("Kuali Portal Index", selenium.getTitle());
083 selenium.selectFrame("iframeportlet");
084 selenium.click("//input[@name='methodToCall.search' and @value='search']");
085 selenium.waitForPageToLoad("30000");
086
087 docId= "link=" + docId;
088 assertTrue(selenium.isElementPresent(docId));
089 if(selenium.isElementPresent(docId)){
090 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
091 }else{
092 assertEquals(docId, selenium.getText("//table[@id='row']/tbody/tr[1]/td[1]"));
093 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
094 }
095 }
096 }