1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package edu.sampleu.main;
17  
18  import org.kuali.rice.testtools.common.JiraAwareFailable;
19  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20  import org.kuali.rice.testtools.selenium.WebDriverUtils;
21  import org.openqa.selenium.By;
22  
23  
24  
25  
26  public class WorkFlowRouteRulesBlanketAppAftBase extends MainTmplMthdSTNavBase{
27  
28      
29  
30  
31  
32  
33      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Routing%20Rules&channelUrl=" + WebDriverUtils
34              .getBaseUrlString() +
35              "/kr/lookup.do?businessObjectClassName=org.kuali.rice.kew.rule.RuleBaseValues&docFormKey=88888888&returnLocation=" +
36              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK+ "&showMaintenanceLinks=true";
37  
38      @Override
39      protected String getBookmarkUrl() {
40          return BOOKMARK_URL;
41      }
42  
43      
44  
45  
46  
47  
48      @Override
49      protected String getLinkLocator() {
50          return "Routing Rules";
51      }
52  
53      protected void testWorkFlowRouteRulesBlanketApp() throws Exception {
54          String random = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
55          waitForPageToLoad();
56          Thread.sleep(3000);
57          assertEquals("Kuali Portal Index", getTitle());
58          selectFrameIframePortlet();
59  
60          
61          waitAndClickCreateNew();
62  
63          
64          waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:documentTypeName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
65  
66          
67          waitAndTypeByName("name", "RoutingRuleDocument");
68  
69          
70          waitAndClickSearch();
71  
72          
73          waitAndClickReturnValue();
74  
75          
76          waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.rule.bo.RuleTemplateBo!!).(((name:ruleTemplateName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
77  
78          
79          waitAndTypeByName("name", "RuleRoutingTemplate");
80  
81          
82          waitAndClickSearch();
83  
84          
85          waitAndClickReturnValue("testWorkFlowRouteRulesBlanketApp");
86  
87          
88          waitAndClickByName("methodToCall.createRule");
89          waitForPageToLoad();
90          String docId = waitForDocId();
91          assertTrue(isElementPresentByName(CANCEL_NAME));
92  
93          
94          waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Test Routing Rule " + random);
95  
96          
97          waitAndClickByXpath("//input[@id='document.newMaintainableObject.forceAction']");
98  
99          
100         waitAndTypeByXpath("//textarea[@id='document.newMaintainableObject.description']", "Test Routing Rule1 "
101                 + random);
102 
103         
104         waitAndTypeByXpath("//input[@id='document.newMaintainableObject.fieldValues(1321~docTypeFullName)']",
105                 "DocumentTypeDocument");
106 
107         
108         waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalName:document.newMaintainableObject.add.personResponsibilities.principalName,))).((`document.newMaintainableObject.add.personResponsibilities.principalName:principalName,`)).((<>)).(([])).((**)).((^^)).((&&)).((/personImpl/)).((~~)).(::::;"
109                 + getBaseUrlString() + "/kr/lookup.do;::::).anchor15");
110 
111         
112         waitAndClickSearch();
113 
114         
115         waitAndClickReturnValue();
116 
117         
118         selectByXpath("//select[@id='document.newMaintainableObject.add.personResponsibilities.actionRequestedCd']",
119                 "ACKNOWLEDGE");
120 
121         
122         waitAndTypeByXpath("//input[@id='document.newMaintainableObject.add.personResponsibilities.priority']", "1");
123 
124         
125         waitAndClickByName("methodToCall.addLine.personResponsibilities.(!!org.kuali.rice.kew.rule.PersonRuleResponsibility!!).(:::;15;:::).anchor15");
126         waitForPageToLoad();
127 
128         
129         waitAndClickByName(BLANKET_APPROVE_NAME);
130 
131         
132         waitForPageToLoad();
133         driver.switchTo().defaultContent(); 
134         waitAndClickDocSearch();
135         waitForPageToLoad();
136         assertEquals("Kuali Portal Index", getTitle());
137         selectFrameIframePortlet();
138         waitAndTypeByName("documentId", docId);
139         waitAndClickSearch();
140 
141         
142         waitForElementPresent(By.linkText(docId));
143         if (isElementPresent(By.linkText(docId))) {
144             if (!DOC_STATUS_FINAL.equalsIgnoreCase(getTextByXpath(DOC_STATUS_XPATH_2))) {
145                 jiraAwareFail("WorkFlowRouteRulesBlanketApp expected:<[FINAL]> but was " + getTextByXpath(DOC_STATUS_XPATH_2));
146             }
147         } else {
148             assertEquals(docId, getTextByXpath(DOC_ID_XPATH_2));
149             assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
150         }
151     }
152 
153     public void testWorkFlowRouteRulesBlanketAppBookmark(JiraAwareFailable failable) throws Exception {
154         testWorkFlowRouteRulesBlanketApp();
155         passed();
156     }
157     public void testWorkFlowRouteRulesBlanketAppNav(JiraAwareFailable failable) throws Exception {
158         testWorkFlowRouteRulesBlanketApp();
159         passed();
160     }
161 }