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 creating and cancelling new and edit Routing Rule Delegation maintenance screens
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029 public class WorkFlowRouteRulesDelegationIT extends UpgradedSeleniumITBase {
030 @Override
031 public String getTestUrl() {
032 return PORTAL;
033 }
034
035 @Test
036 /**
037 * tests that a new Routing Rule Delegation maintenance document can be cancelled
038 */
039 public void testCreateNew() throws Exception {
040 assertEquals("Kuali Portal Index", selenium.getTitle());
041 selenium.click("link=Routing Rules Delegation");
042 selenium.waitForPageToLoad("30000");
043 assertEquals("Kuali Portal Index", selenium.getTitle());
044 selenium.selectFrame("iframeportlet");
045 selenium.click("//img[@alt='create new']");
046 // selenium.selectFrame("relative=up");
047 selenium.waitForPageToLoad("30000");
048 selenium.click("name=methodToCall.performLookup.(!!org.kuali.rice.kew.rule.RuleBaseValues!!).(((id:parentRuleId))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
049 selenium.waitForPageToLoad("30000");
050 selenium.click("css=td.infoline > input[name=\"methodToCall.search\"]");
051 selenium.waitForPageToLoad("30000");
052 selenium.click("css=a[title=\"return valueRule Id=1046 \"]");
053 selenium.waitForPageToLoad("30000");
054 selenium.click("name=parentResponsibilityId");
055 selenium.click("name=methodToCall.createDelegateRule");
056 selenium.waitForPageToLoad("30000");
057 assertTrue(selenium.isElementPresent("methodToCall.cancel"));
058 selenium.click("methodToCall.cancel");
059 selenium.waitForPageToLoad("30000");
060 selenium.click("methodToCall.processAnswer.button0");
061 selenium.waitForPageToLoad("30000");
062 }
063
064 // @Test // There are no results from the search so no edit link to click on
065 /**
066 * tests that a Routing Rule Delegation maintenance document is created for an edit operation originating from a lookup screen
067 */
068 public void testEditRouteRulesDelegation() throws Exception {
069 assertEquals("Kuali Portal Index", selenium.getTitle());
070 selenium.click("link=Routing Rules Delegation");
071 selenium.waitForPageToLoad("30000");
072 assertEquals("Kuali Portal Index", selenium.getTitle());
073 selenium.selectFrame("iframeportlet");
074 selenium.setSpeed("2000");
075 selenium.click("//input[@name='methodToCall.search' and @value='search']");
076 selenium.waitForPageToLoad("30000");
077 selenium.click("link=edit");
078 selenium.waitForPageToLoad("30000");
079 assertTrue(selenium.isElementPresent("methodToCall.cancel"));
080 selenium.click("methodToCall.cancel");
081 selenium.waitForPageToLoad("30000");
082 selenium.click("methodToCall.processAnswer.button0");
083 selenium.waitForPageToLoad("30000");
084
085 }
086
087 @Test
088 public void testCreateNewRRDTravelRequestDestRouting() throws Exception {
089 selenium.click("link=Routing Rules Delegation");
090 selenium.waitForPageToLoad("30000");
091 selenium.selectFrame("iframeportlet");
092 selenium.click("css=img[alt=\"create new\"]");
093 selenium.waitForPageToLoad("30000");
094 selenium.click("name=methodToCall.performLookup.(!!org.kuali.rice.kew.rule.RuleBaseValues!!).(((id:parentRuleId))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
095 selenium.waitForPageToLoad("30000");
096 selenium.click("css=td.infoline > input[name=\"methodToCall.search\"]");
097 selenium.waitForPageToLoad("30000");
098 selenium.click("css=a[title=\"return valueRule Id=1046 \"]");
099 selenium.waitForPageToLoad("30000");
100 selenium.click("name=parentResponsibilityId");
101 selenium.click("name=methodToCall.createDelegateRule");
102 selenium.waitForPageToLoad("30000");
103 selenium.click("name=methodToCall.cancel");
104 selenium.waitForPageToLoad("30000");
105 selenium.click("name=methodToCall.processAnswer.button0");
106 selenium.waitForPageToLoad("30000");
107 selenium.selectWindow("null");
108 selenium.click("xpath=(//input[@name='imageField'])[2]");
109 selenium.waitForPageToLoad("30000");
110 }
111 }