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 edu.samplu.common.ITUtil;
19  import edu.samplu.common.WebDriverLegacyITBase;
20  import org.junit.Test;
21  
22  import static org.junit.Assert.assertEquals;
23  import static org.junit.Assert.assertTrue;
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 WorkFlowRouteRulesDelegationLegacyIT extends WebDriverLegacyITBase {
31      @Override
32      public String getTestUrl() {
33          return ITUtil.PORTAL;
34      }
35  
36  //    @Test // There are no results from the search so no edit link to click on
37      /**
38       * tests that a Routing Rule Delegation maintenance document is created for an edit operation originating from a lookup screen
39       */
40      public void testEditRouteRulesDelegation() throws Exception {
41          assertEquals("Kuali Portal Index", getTitle());
42          waitAndClickByLinkText("Routing Rules Delegation");
43          waitForPageToLoad();
44          Thread.sleep(3000);
45          assertEquals("Kuali Portal Index", getTitle());
46          selectFrame("iframeportlet");
47        //  setSpeed("2000");
48          waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
49          waitForPageToLoad();
50          Thread.sleep(3000);
51          waitAndClickByLinkText("edit");
52          waitForPageToLoad();
53          Thread.sleep(3000);
54          assertTrue(isElementPresentByName("methodToCall.cancel"));
55          waitAndClickByName("methodToCall.cancel");
56          waitForPageToLoad();
57          Thread.sleep(3000);
58          waitAndClickByName("methodToCall.processAnswer.button0");
59          waitForPageToLoad();
60          passed();
61      }
62      
63      @Test
64      public void testCreateNewRRDTravelRequestDestRouting() throws Exception {
65          waitAndClickByLinkText("Routing Rules Delegation");
66          waitForPageToLoad();
67          selectFrame("iframeportlet");
68          waitAndClick("img[alt=\"create new\"]");
69          waitForPageToLoad();
70          waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.rule.RuleBaseValues!!).(((id:parentRuleId))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
71          waitForPageToLoad();
72     //     Thread.sleep(6000);
73          waitAndClickByXpath("//td[@class='infoline']/input[@name='methodToCall.search']");
74          waitForPageToLoad();
75       //   Thread.sleep(6000);
76          waitAndClick("a[title=\"return valueRule Id=1046 \"]");
77          waitForPageToLoad();
78          waitAndClickByName("parentResponsibilityId");
79          waitAndClickByName("methodToCall.createDelegateRule");
80          waitForPageToLoad();
81          Thread.sleep(3000);
82          waitAndClickByName("methodToCall.cancel");
83          waitForPageToLoad();
84          //Thread.sleep(3000);
85          waitAndClickByName("methodToCall.processAnswer.button0");
86          waitForPageToLoad();
87          //Thread.sleep(3000);
88          driver.switchTo().defaultContent();
89          waitAndClickByXpath("(//input[@name='imageField'])[2]");
90          waitForPageToLoad();
91          passed();
92      }
93  }