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.UpgradedSeleniumITBase;
20 import org.junit.Test;
21
22 import static org.junit.Assert.assertEquals;
23 import static org.junit.Assert.assertTrue;
24
25
26
27
28
29
30 public class WorkFlowRouteRulesBlanketAppIT extends UpgradedSeleniumITBase {
31 @Override
32 public String getTestUrl() {
33 return ITUtil.PORTAL;
34 }
35 @Test
36 public void testUntitled() throws Exception {
37 assertEquals("Kuali Portal Index", getTitle());
38
39 waitAndClick("link=Routing Rules");
40 waitForPageToLoad();
41 assertEquals("Kuali Portal Index", getTitle());
42 selectFrame("iframeportlet");
43
44 waitAndClick("//img[@alt='create new']");
45 waitForPageToLoad();
46
47 waitAndClick("methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:documentTypeName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
48 waitForPageToLoad();
49
50 waitAndType("name", "RoutingRuleDocument");
51
52 waitAndClick("//input[@name='methodToCall.search' and @value='search']");
53 waitForPageToLoad();
54
55 waitAndClick("link=return value");
56 waitForPageToLoad();
57
58 waitAndClick("methodToCall.performLookup.(!!org.kuali.rice.kew.rule.bo.RuleTemplateBo!!).(((name:ruleTemplateName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
59 waitForPageToLoad();
60
61 waitAndType("name", "RuleRoutingTemplate");
62
63 waitAndClick("//input[@name='methodToCall.search' and @value='search']");
64 waitForPageToLoad();
65
66 waitAndClick("link=return value");
67 waitForPageToLoad();
68
69 waitAndClick("methodToCall.createRule");
70 waitForPageToLoad();
71 String docId = getText("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]");
72 assertTrue(isElementPresent("methodToCall.cancel"));
73
74 waitAndType("//input[@id='document.documentHeader.documentDescription']", "Test Routing Rule");
75
76 waitAndClick("//input[@id='document.newMaintainableObject.forceAction']");
77
78 waitAndType("//textarea[@id='document.newMaintainableObject.description']", "Test Routing Rule1");
79
80 waitAndType("//input[@id='document.newMaintainableObject.fieldValues(1321~docTypeFullName)']", "DocumentTypeDocument");
81
82 waitAndClick("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");
83 waitForPageToLoad();
84
85 waitAndClick("//input[@name='methodToCall.search' and @value='search']");
86 waitForPageToLoad();
87
88 waitAndClick("link=return value");
89 waitForPageToLoad();
90
91 select("//select[@id='document.newMaintainableObject.add.personResponsibilities.actionRequestedCd']", "label=ACKNOWLEDGE");
92
93 waitAndType("//input[@id='document.newMaintainableObject.add.personResponsibilities.priority']", "1");
94
95 waitAndClick("methodToCall.addLine.personResponsibilities.(!!org.kuali.rice.kew.rule.PersonRuleResponsibility!!)");
96 waitForPageToLoad();
97 checkForIncidentReport("methodToCall.blanketApprove");
98 waitAndClick("methodToCall.blanketApprove");
99 waitForPageToLoad();
100 selectWindow("null");
101 Thread.sleep(2000);
102 waitAndClick("//img[@alt='doc search']");
103 waitForPageToLoad();
104 assertEquals("Kuali Portal Index", getTitle());
105 selectFrame("iframeportlet");
106 waitAndClick("//input[@name='methodToCall.search' and @value='search']");
107 waitForPageToLoad();
108
109 docId= "link=" + docId;
110 assertTrue(isElementPresent(docId));
111 if(isElementPresent(docId)){
112 assertEquals("FINAL", getText("//table[@id='row']/tbody/tr[1]/td[4]"));
113 }else{
114 assertEquals(docId, getText("//table[@id='row']/tbody/tr[1]/td[1]"));
115 assertEquals("FINAL", getText("//table[@id='row']/tbody/tr[1]/td[4]"));
116 }
117 }
118 }