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.selenium.AutomatedFunctionalTestUtils;
19 import org.kuali.rice.testtools.selenium.WebDriverUtils;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class EditRuleAftBase extends MainTmplMthdSTNavBase{
26
27
28
29
30
31
32 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Create%20New%20Agenda&channelUrl=" + WebDriverUtils
33 .getBaseUrlString() +"/kr-krad/krmsAgendaEditor?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.ui.AgendaEditor&returnLocation=" +
34 AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
35
36 @Override
37 protected String getBookmarkUrl() {
38 return BOOKMARK_URL;
39 }
40
41
42
43
44
45
46 @Override
47 protected String getLinkLocator() {
48 return "Create New Agenda";
49 }
50
51 protected void testEditRuleSaveSubmit() throws Exception {
52 selectFrameIframePortlet();
53 String desc = getDescriptionUnique();
54 String docId = waitForAgendaDocId();
55 waitAndSelectLabeled("Namespace:", "Kuali Rules Test");
56 waitAndTypeLabeledInput("Name:", desc);
57 waitAndTypeLabeledInput("Context:", "Context1");
58 addAndEditRule();
59 waitAndClickButtonByExactText("Add Rule");
60 saveSuccessfully();
61 submitSuccessfully();
62
63
64
65 }
66
67 protected void testEditRuleBlanketApprove() throws Exception {
68 selectFrameIframePortlet();
69 String desc = getDescriptionUnique();
70 String docId = waitForAgendaDocId();
71 waitAndSelectLabeled("Namespace:", "Kuali Rules Test");
72 waitAndTypeLabeledInput("Name:", desc);
73 waitAndTypeLabeledInput("Context:", "Context1");
74 addAndEditRule();
75 waitAndClickButtonByExactText("Add Rule");
76 waitAndClickButtonByExactText("Blanket Approve");
77 waitAndClickConfirmBlanketApproveOk();
78 }
79
80 private void addAndEditRule() throws Exception {
81
82 waitAndClickButtonByExactText("Add Rule");
83 String desc = getDescriptionUnique();
84 waitAndTypeByName("document.newMaintainableObject.dataObject.agendaItemLine.rule.name", "Rule Name " + desc);
85 waitAndClickButtonByExactText("Add");
86 waitAndTypeByName(
87 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].data.proposition.description",
88 "Rule 1");
89 selectByName(
90 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].data.proposition.parameters[0].value",
91 "Account");
92 waitAndTypeByName(
93 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].data.proposition.parameters[1].value",
94 "12345");
95 selectByName(
96 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].data.proposition.parameters[2].value",
97 "=");
98 waitAndClickByXpath("//input[@type='image' and @alt='Add Parent']");
99 waitAndClickButtonByExactText("Add");
100 waitForElementPresentByXpath(
101 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].children[2].data.proposition.description");
102 waitAndTypeByName(
103 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].children[2].data.proposition.description",
104 "Rule 2");
105 selectByName(
106 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].children[2].data.proposition.parameters[0].value",
107 "Account");
108 selectByName(
109 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].children[2].data.proposition.parameters[2].value",
110 "=");
111 waitAndTypeByName(
112 "document.newMaintainableObject.dataObject.agendaItemLine.rule.propositionTree.rootElement.children[0].children[2].data.proposition.parameters[1].value",
113 "12345");
114 waitAndClickByXpath("//div[4]/fieldset/div/input[@type='image' and @alt='Edit']");
115 waitForTextPresent("Rule 2");
116
117
118 waitAndClickButtonByExactText("Up");
119 waitAndClickButtonByExactText("Down");
120 waitAndClickButtonByExactText("Add Parent");
121 waitAndClickButtonByExactText("Left");
122 waitAndClickButtonByExactText("Up");
123 waitAndClickButtonByExactText("Right");
124
125
126 waitAndClickButtonByExactText("Cut");
127 waitAndClickByXpath("//a[@class='ruleTreeNode compoundNode']");
128 waitAndClickButtonByExactText("Paste");
129 waitAndClickButtonByExactText("refresh");
130 }
131
132 }