1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.mainmenu.test;
17
18 import edu.samplu.common.ITUtil;
19 import edu.samplu.common.WebDriverLegacyITBase;
20
21 import org.junit.Test;
22 import org.openqa.selenium.By;
23
24 import static org.junit.Assert.assertEquals;
25 import static org.junit.Assert.assertTrue;
26
27
28
29
30
31
32 public class WorkFlowRouteRulesBlanketAppLegacyIT extends WebDriverLegacyITBase {
33 @Override
34 public String getTestUrl() {
35 return ITUtil.PORTAL;
36 }
37 @Test
38 public void testUntitled() throws Exception {
39 assertEquals("Kuali Portal Index", getTitle());
40
41 waitAndClickByLinkText("Routing Rules");
42 waitForPageToLoad();
43 Thread.sleep(3000);
44 assertEquals("Kuali Portal Index", getTitle());
45 selectFrame("iframeportlet");
46
47 waitAndClickByXpath("//img[@alt='create new']");
48 waitForPageToLoad();
49
50 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:documentTypeName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
51 waitForPageToLoad();
52
53 waitAndTypeByName("name", "RoutingRuleDocument");
54
55 waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
56 waitForPageToLoad();
57
58 waitAndClickByLinkText("return value");
59 waitForPageToLoad();
60
61 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.rule.bo.RuleTemplateBo!!).(((name:ruleTemplateName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
62 waitForPageToLoad();
63
64 waitAndTypeByName("name", "RuleRoutingTemplate");
65
66 waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
67 waitForPageToLoad();
68
69 waitAndClickByLinkText("return value");
70 waitForPageToLoad();
71
72 waitAndClickByName("methodToCall.createRule");
73 waitForPageToLoad();
74 Thread.sleep(3000);
75 String docId = getTextByXpath("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]");
76 assertTrue(isElementPresentByName("methodToCall.cancel"));
77
78 waitAndTypeByXpath("//input[@id='document.documentHeader.documentDescription']", "Test Routing Rule");
79
80 waitAndClickByXpath("//input[@id='document.newMaintainableObject.forceAction']");
81
82 waitAndTypeByXpath("//textarea[@id='document.newMaintainableObject.description']", "Test Routing Rule1");
83
84 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.fieldValues(1321~docTypeFullName)']", "DocumentTypeDocument");
85
86 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalName:document.newMaintainableObject.add.personResponsibilities.principalName,))).((`document.newMaintainableObject.add.personResponsibilities.principalName:principalName,`)).((<>)).(([])).((**)).((^^)).((&&)).((/personImpl/)).((~~)).(::::;" + getBaseUrlString() + "/kr/lookup.do;::::).anchor15");
87 waitForPageToLoad();
88
89 waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
90 waitForPageToLoad();
91
92 waitAndClickByLinkText("return value");
93 waitForPageToLoad();
94
95 selectByXpath("//select[@id='document.newMaintainableObject.add.personResponsibilities.actionRequestedCd']", "ACKNOWLEDGE");
96
97 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.add.personResponsibilities.priority']", "1");
98
99 waitAndClickByName("methodToCall.addLine.personResponsibilities.(!!org.kuali.rice.kew.rule.PersonRuleResponsibility!!).(:::;15;:::).anchor15");
100 waitForPageToLoad();
101 checkForIncidentReport("methodToCall.blanketApprove");
102 waitAndClickByName("methodToCall.blanketApprove");
103 waitForPageToLoad();
104 driver.switchTo().defaultContent();
105 Thread.sleep(2000);
106 waitAndClickByXpath("//img[@alt='doc search']");
107 waitForPageToLoad();
108 assertEquals("Kuali Portal Index", getTitle());
109 selectFrame("iframeportlet");
110 waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
111 waitForPageToLoad();
112
113
114 assertTrue(isElementPresent(By.linkText(docId)));
115 if(isElementPresent(By.linkText(docId))){
116 assertEquals("FINAL", getTextByXpath("//table[@id='row']/tbody/tr[1]/td[4]"));
117 }else{
118 assertEquals(docId, getTextByXpath("//table[@id='row']/tbody/tr[1]/td[1]"));
119 assertEquals("FINAL", getTextByXpath("//table[@id='row']/tbody/tr[1]/td[4]"));
120 }
121
122 }
123 }
124