1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20
21
22
23
24 public class LabsConfigurationAft extends WebDriverLegacyITBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=LabsConfigurationView&formKey=b553a5b1-9748-4d86-bd9a-5cb3829f74d2&cacheKey=ge1ddsklfoqa7454h9j07e";
30
31
32
33
34 private static final String TRAVEL_ACCOUNT_NUMBER_NAME="lookupCriteria[number]";
35
36
37
38
39 private static final String TRAVEL_ACCOUNT_NAME="lookupCriteria[name]";
40
41
42
43
44 private static final String SEARCH_BUTTON_TEXT="Search";
45
46
47
48
49 private static final String CLEAR_VALUES_BUTTON_TEXT="Clear Values";
50
51
52
53
54 private static final String PRINCIPAL_NAME="lookupCriteria[fiscalOfficer.principalName]";
55
56 @Override
57 protected String getBookmarkUrl() {
58 return BOOKMARK_URL;
59 }
60
61 @Override
62 protected void navigate() throws Exception {
63 }
64
65 private void testLabsConfigurationWithClassInstantiation() throws InterruptedException {
66 waitAndClickByLinkText("Configuration with Class Instantiation");
67
68
69 waitAndTypeByName(TRAVEL_ACCOUNT_NUMBER_NAME,"a2");
70 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
71 waitForTextPresent("a2");
72 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
73
74
75 waitAndTypeByName(TRAVEL_ACCOUNT_NAME,"Travel Account 2");
76 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
77 waitForTextPresent("Travel Account 2");
78 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
79
80
81 waitAndTypeByName(PRINCIPAL_NAME,"fran");
82 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
83 waitForTextPresent("Travel Account");
84 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
85
86
87 waitAndTypeByName("lookupCriteria[rangeLowerBoundKeyPrefix_createDate]","06/01/2000");
88 waitAndTypeByName("lookupCriteria[createDate]","06/01/2050");
89 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
90 waitForTextPresent("Travel Account");
91 }
92
93 private void testConfigurationWithSpringServiceExpression() throws InterruptedException {
94
95 waitAndClickByLinkText("Configuration with Spring Service Expression");
96
97
98 waitAndTypeByName(TRAVEL_ACCOUNT_NUMBER_NAME,"a2");
99 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
100 waitForTextPresent("a2");
101 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
102
103
104 waitAndTypeByName(TRAVEL_ACCOUNT_NAME,"Travel Account 2");
105 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
106 waitForTextPresent("Travel Account 2");
107 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
108
109
110 waitAndTypeByName("lookupCriteria[rangeLowerBoundKeyPrefix_createDate]","06/01/2000");
111 waitAndTypeByName("lookupCriteria[createDate]","06/01/2050");
112 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
113 waitForTextPresent("Travel Account");
114
115
116 waitAndTypeByName(PRINCIPAL_NAME,"fran");
117 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
118 waitForTextPresent("Travel Account");
119 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
120 }
121
122 @Test
123 public void testLabsConfigurationWithClassInstantiationBookmark() throws Exception {
124 testLabsConfigurationWithClassInstantiation();
125 passed();
126 }
127
128 @Test
129 public void testLabsConfigurationWithSpringServiceExpressionBookmark() throws Exception {
130 testConfigurationWithSpringServiceExpression();
131 passed();
132 }
133 }