1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.clientresponsiveness;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20 import org.openqa.selenium.By;
21
22
23
24
25
26
27 public class LibraryClientResponsivenessInlineEditingAft extends WebDriverLegacyITBase {
28
29
30 protected static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-InlineEdit";
31
32
33
34
35
36 @Override
37 protected String getBookmarkUrl() { return BOOKMARK_URL; }
38
39
40
41
42
43 @Override
44 protected void navigate() throws Exception {
45 waitAndClickLibraryLink();
46 waitAndClickByLinkText("Client Responsiveness");
47 waitAndClickByLinkText("Inline Editing");
48 }
49
50
51
52
53
54 protected void testClientResponsivenessInlineEditing() throws Exception {
55 testClientResponsivenessInlineEditTextField();
56 testClientResponsivenessInlineEditTextFieldWithComplexMarkUp();
57 testClientResponsivenessInlineEditTextFieldViaAjax();
58 testClientResponsivenessInlineEditTextArea();
59 testClientResponsivenessInlineEditTableCollection();
60 testClientResponsivenessInlineEditLabelColumnCollectionGrid();
61 }
62
63
64
65
66
67 protected void testClientResponsivenessInlineEditTextField() throws Exception {
68 waitForElementPresent("//section[@id='Demo-InlineEdit-Example1']/div/button[contains(text(),'My InLine Book Title')]");
69 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example1']/div/button");
70 waitAndTypeByXpath("//div[@data-parent='Demo-InlineEdit-Example1']/div/input[@name='dataField3']", "1");
71 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example1']/div/div/div/button[@title='Save']");
72 waitForElementPresent("//section[@id='Demo-InlineEdit-Example1']/div/button[contains(text(),'My Inline Book Title1')]");
73 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example1']/div/button");
74 waitAndTypeByXpath("//div[@data-parent='Demo-InlineEdit-Example1']/div/input[@name='dataField3']", "a");
75 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example1']/div/div/div/button[@title='Cancel']");
76 waitForElementPresent("//section[@id='Demo-InlineEdit-Example1']/div/button[contains(text(),'My Inline Book Title1')]");
77 }
78
79
80
81
82
83 protected void testClientResponsivenessInlineEditTextFieldWithComplexMarkUp() throws Exception {
84 selectByName("exampleShown","Inline Edit Text Field w Complex Markup");
85 waitForElementPresent("//section[@id='Demo-InlineEdit-Example2']/div/button[contains(text(),'My Book Title')]");
86 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example2']/div/button");
87 waitAndTypeByXpath("//div[@data-parent='Demo-InlineEdit-Example2']/div/input[@name='dataField6']", "a");
88 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example2']/div/div/div/button[@title='Save']");
89 waitForElementPresent("//section[@id='Demo-InlineEdit-Example2']/div/button[contains(text(),'My Book Titlea')]");
90 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example2']/div/button");
91 waitAndTypeByXpath("//div[@data-parent='Demo-InlineEdit-Example2']/div/input[@name='dataField6']", "b");
92 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example2']/div/div/div/button[@title='Cancel']");
93 waitForElementPresent("//section[@id='Demo-InlineEdit-Example2']/div/button[contains(text(),'My Book Titlea')]");
94 }
95
96
97
98
99
100 protected void testClientResponsivenessInlineEditTextFieldViaAjax() throws Exception {
101 selectByName("exampleShown","Inline Edit Text Field via Ajax");
102 waitForElementPresent("//section[@id='Demo-InlineEdit-Example3']/div/button[contains(text(),'10011')]");
103 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example3']/div/button");
104 waitAndTypeByName("dataField1","a");
105 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example3']/div/div/div/button[@title='Save']");
106 waitForElementPresent("//section[@id='Demo-InlineEdit-Example3']/div/button[contains(text(),'10011a')]");
107 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example3']/div/button");
108 waitAndTypeByName("dataField1","b");
109 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example3']/div/div/div/button[@title='Cancel']");
110 waitForElementPresent("//section[@id='Demo-InlineEdit-Example3']/div/button[contains(text(),'10011a')]");
111 }
112
113
114
115
116
117 protected void testClientResponsivenessInlineEditTextArea() throws Exception {
118 selectByName("exampleShown","Inline Edit Textarea");
119 waitForElementPresent("//section[@id='Demo-InlineEdit-Example4']/div/button/pre[contains(text(),'Book')]");
120 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example4']/div/button");
121 waitAndTypeByName("dataField5","asdf");
122 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example4']/div/div/div/button[@title='Save']");
123 waitForElementPresent("//section[@id='Demo-InlineEdit-Example4']/div/button/pre[contains(text(),'asdf')]");
124 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example4']/div/button");
125 waitAndTypeByName("dataField5","b");
126 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example4']/div/div/div/button[@title='Cancel']");
127 waitForElementPresent("//section[@id='Demo-InlineEdit-Example4']/div/button/pre[contains(text(),'asdf')]");
128 }
129
130
131
132
133
134 protected void testClientResponsivenessInlineEditSelect() throws Exception {
135 selectByName("exampleShown","Inline Edit Select");
136 waitForElementPresent("//section[@id='Demo-InlineEdit-Example5']/div/button[contains(text(),'Option 3')]");
137 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example5']/div/button");
138 selectByName("dataField7","Option 1");
139 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example5']/div/div/div/button[@title='Save']");
140 waitForElementPresent("//section[@id='Demo-InlineEdit-Example5']/div/button[contains(text(),'1')]");
141 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example5']/div/button");
142 selectByName("dataField7","Option 2");
143 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example5']/div/div/div/button[@title='Cancel']");
144 waitForElementPresent("//section[@id='Demo-InlineEdit-Example5']/div/button[contains(text(),'1')]");
145 }
146
147
148
149
150
151 protected void testClientResponsivenessInlineEditPopoverWidget() throws Exception {
152 selectByName("exampleShown","Inline Edit in Popover widget");
153 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example6']/button");
154 waitForElementPresentByXpath("//div[@id='Demo-PopoverContent-Group']/div/button[contains(text(),'My Second Book Title')]");
155 waitAndClickByXpath("//div[@id='Demo-PopoverContent-Group']/div/button");
156 waitAndTypeByName("dataField8","a");
157 waitAndClickByXpath("//div[@id='Demo-PopoverContent-Group']/div/div/div/button[@title='Save']");
158 waitForElementPresentByXpath("//div[@id='Demo-PopoverContent-Group']/div/button[contains(text(),'My Second Book Titlea')]");
159 waitAndClickByXpath("//div[@id='Demo-PopoverContent-Group']/div/button");
160 waitAndTypeByName("dataField8","b");
161 waitAndClickByXpath("//div[@id='Demo-PopoverContent-Group']/div/div/div/button[@title='Cancel']");
162 waitForElementPresentByXpath("//div[@id='Demo-PopoverContent-Group']/div/button[contains(text(),'My Second Book Titlea')]");
163 waitForElementPresentByXpath("//div[@id='Demo-PopoverContent-Group']/div[2]/button");
164 waitForElementPresentByXpath("//div[@id='Demo-PopoverContent-Group']/div[3]/input");
165 waitAndClickByXpath("//div[@id='Demo-PopoverContent-Group']/button");
166 acceptAlertIfPresent();
167 }
168
169
170
171
172
173 protected void testClientResponsivenessInlineEditDisclosureWidget() throws Exception {
174 selectByName("exampleShown","Inline Edit in Disclosure widget");
175 waitForElementPresentByXpath("//div[@style='display: none; overflow: hidden;']");
176 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example7']/section/header/h3/a");
177 waitForElementPresentByXpath("//div[@style='display: block; overflow: hidden;']");
178 waitForElementPresent("//section[@id='Demo-InlineEdit-Example7']/section/div/div/button[contains(text(),'My Third Book Title')]");
179 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example7']/section/div/div/button");
180 waitAndTypeByName("dataField11","a");
181 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example7']/section/div/div/div/div/button[@title='Save']");
182 waitForElementPresent("//section[@id='Demo-InlineEdit-Example7']/section/div/div/button[contains(text(),'My Third Book Titlea')]");
183 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example7']/section/div/div/button");
184 waitAndTypeByName("dataField11","b");
185 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example7']/section/div/div/div/div/button[@title='Cancel']");
186 waitForElementPresent("//section[@id='Demo-InlineEdit-Example7']/section/div/div/button[contains(text(),'My Third Book Titlea')]");
187 }
188
189
190
191
192
193 protected void testClientResponsivenessInlineEditTableCollection() throws Exception {
194 selectByName("exampleShown","Inline Edit in Table Collection");
195 waitForElementPresent("//table/tbody/tr/td/div/button[contains(text(),'1')]");
196 waitAndClickByXpath("//table/tbody/tr/td/div/button");
197 waitAndTypeByName("collection1[0].field1","a");
198 waitAndClickByXpath("//table/tbody/tr/td/div/div/div/button[@title='Save']");
199 waitForElementPresent("//table/tbody/tr/td/div/button[contains(text(),'1a')]");
200 waitAndClickByXpath("//table/tbody/tr/td/div/button");
201 waitAndTypeByName("collection1[0].field1","b");
202 waitAndClickByXpath("//table/tbody/tr/td/div/div/div/button[@title='Cancel']");
203 waitForElementPresent("//table/tbody/tr/td/div/button[contains(text(),'1a')]");
204 }
205
206
207
208
209
210 protected void testClientResponsivenessInlineEditLabelColumnCollectionGrid() throws Exception {
211 selectByName("exampleShown","Inline Edit in a 1 Label Column CSS Grid");
212 waitForElementPresent("//section[@id='Demo-InlineEdit-Example9']/div/div/button");
213 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example9']/div/div/button");
214 waitAndTypeByName("inputField10","1");
215 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example9']/div/div/div/div/button[@title='Save']");
216 waitForElementPresent("//section[@id='Demo-InlineEdit-Example9']/div/div/button[contains(text(),'1')]");
217 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example9']/div/div/button");
218 waitAndTypeByName("inputField10","a");
219 waitAndClickByXpath("//section[@id='Demo-InlineEdit-Example9']/div/div/div/div/button[@title='Cancel']");
220 waitForElementPresent("//section[@id='Demo-InlineEdit-Example9']/div/div/button[contains(text(),'1')]");
221 }
222
223
224
225
226
227 @Test
228 public void testClientResponsivenessComponentRefreshBookmark() throws Exception {
229 testClientResponsivenessInlineEditing();
230 passed();
231 }
232
233
234
235
236
237 @Test
238 public void testClientResponsivenessComponentRefreshNav() throws Exception {
239 testClientResponsivenessInlineEditing();
240 passed();
241 }
242
243 @Test
244 public void testClientResponsivenessInlineEditDisclosureWidgetBookmark() throws Exception {
245 testClientResponsivenessInlineEditDisclosureWidget();
246 passed();
247 }
248
249 @Test
250 public void testClientResponsivenessInlineEditDisclosureWidgetNav() throws Exception {
251 testClientResponsivenessInlineEditDisclosureWidget();
252 passed();
253 }
254
255 @Test
256 public void testClientResponsivenessInlineEditSelectBookmark() throws Exception {
257 testClientResponsivenessInlineEditSelect();
258 passed();
259 }
260
261 @Test
262 public void testClientResponsivenessInlineEditSelectNav() throws Exception {
263 testClientResponsivenessInlineEditSelect();
264 passed();
265 }
266
267 @Test
268 public void testClientResponsivenessInlineEditPopoverWidgetBookmark() throws Exception {
269 testClientResponsivenessInlineEditPopoverWidget();
270 passed();
271 }
272
273 @Test
274 public void testClientResponsivenessInlineEditPopoverWidgetNav() throws Exception {
275 testClientResponsivenessInlineEditPopoverWidget();
276 passed();
277 }
278 }