View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package edu.samplu.mainmenu.test;
17  
18  import static org.junit.Assert.assertEquals;
19  import static org.junit.Assert.assertTrue;
20  
21  import edu.samplu.common.ITUtil;
22  import edu.samplu.common.UpgradedSeleniumITBase;
23  import org.junit.Test;
24  
25  /**
26   * tests creating and cancelling new and edit Routing Rule Delegation maintenance screens
27   * 
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   */
30  public class WorkFlowRouteRulesDelegationIT extends UpgradedSeleniumITBase {
31      @Override
32      public String getTestUrl() {
33          return ITUtil.PORTAL;
34      }
35  
36      @Test
37      /**
38       * tests that a new Routing Rule Delegation maintenance document can be cancelled
39       */
40      public void testCreateNew() throws Exception {
41          assertEquals("Kuali Portal Index", getTitle());
42          waitAndClick("link=Routing Rules Delegation");
43          waitForPageToLoad();
44          assertEquals("Kuali Portal Index", getTitle());
45          selectFrame("iframeportlet");
46          waitAndClick("//img[@alt='create new']");
47  //        selectFrame("relative=up");
48          waitForPageToLoad();
49          waitAndClick("name=methodToCall.performLookup.(!!org.kuali.rice.kew.rule.RuleBaseValues!!).(((id:parentRuleId))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
50          waitForPageToLoad();
51          waitAndClick("css=td.infoline > input[name=\"methodToCall.search\"]");
52          waitForPageToLoad();
53          waitAndClick("css=a[title=\"return valueRule Id=1046 \"]");
54          waitForPageToLoad();
55          waitAndClick("name=parentResponsibilityId");
56          waitAndClick("name=methodToCall.createDelegateRule");
57          waitForPageToLoad();
58          assertTrue(isElementPresent("methodToCall.cancel"));
59          waitAndClick("methodToCall.cancel");
60          waitForPageToLoad();
61          waitAndClick("methodToCall.processAnswer.button0");
62          waitForPageToLoad();
63      }
64  
65  //    @Test // There are no results from the search so no edit link to click on
66      /**
67       * tests that a Routing Rule Delegation maintenance document is created for an edit operation originating from a lookup screen
68       */
69      public void testEditRouteRulesDelegation() throws Exception {
70          assertEquals("Kuali Portal Index", getTitle());
71          waitAndClick("link=Routing Rules Delegation");
72          waitForPageToLoad();
73          assertEquals("Kuali Portal Index", getTitle());
74          selectFrame("iframeportlet");
75          setSpeed("2000");
76          waitAndClick("//input[@name='methodToCall.search' and @value='search']");
77          waitForPageToLoad();
78          waitAndClick("link=edit");
79          waitForPageToLoad();
80          assertTrue(isElementPresent("methodToCall.cancel"));
81          waitAndClick("methodToCall.cancel");
82          waitForPageToLoad();
83          waitAndClick("methodToCall.processAnswer.button0");
84          waitForPageToLoad();
85                
86      }
87      
88      @Test
89      public void testCreateNewRRDTravelRequestDestRouting() throws Exception {
90          waitAndClick("link=Routing Rules Delegation");
91          waitForPageToLoad();
92          selectFrame("iframeportlet");
93          waitAndClick("css=img[alt=\"create new\"]");
94          waitForPageToLoad();
95          waitAndClick("name=methodToCall.performLookup.(!!org.kuali.rice.kew.rule.RuleBaseValues!!).(((id:parentRuleId))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
96          waitForPageToLoad();
97          waitAndClick("css=td.infoline > input[name=\"methodToCall.search\"]");
98          waitForPageToLoad();
99          waitAndClick("css=a[title=\"return valueRule Id=1046 \"]");
100         waitForPageToLoad();
101         waitAndClick("name=parentResponsibilityId");
102         waitAndClick("name=methodToCall.createDelegateRule");
103         waitForPageToLoad();
104         waitAndClick("name=methodToCall.cancel");
105         waitForPageToLoad();
106         waitAndClick("name=methodToCall.processAnswer.button0");
107         waitForPageToLoad();
108         selectWindow("null");
109         waitAndClick("xpath=(//input[@name='imageField'])[2]");
110         waitForPageToLoad();
111     }
112 }