1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.travel.krad.test;
17
18 import edu.samplu.common.Failable;
19 import edu.samplu.common.ITUtil;
20 import edu.samplu.common.WebDriverLegacyITBase;
21
22
23
24
25
26
27 public abstract class UIFComponentValidationRegexPatternAbstractSmokeTestBase extends WebDriverLegacyITBase {
28
29
30
31
32 public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&readOnlyFields=field91";
33
34
35 protected void bookmark() {
36 open(ITUtil.getBaseUrlString() + BOOKMARK_URL);
37 }
38
39
40
41
42
43
44 @Override
45 public String getTestUrl() {
46 return ITUtil.PORTAL;
47 }
48
49
50 protected void navigation() throws InterruptedException {
51 waitAndClickKRAD();
52 waitAndClickByXpath(KITCHEN_SINK_XPATH);
53 switchToWindow(KUALI_UIF_COMPONENTS_WINDOW_XPATH);
54 }
55
56 protected void testValidCharacterConstraintNav(Failable failable) throws Exception {
57 navigation();
58 testValidCharacterConstraint();
59 passed();
60 }
61
62 protected void testValidCharacterConstraintBookmark(Failable failable) throws Exception {
63 testValidCharacterConstraint();
64 passed();
65 }
66
67 protected void testValidCharacterConstraint() throws Exception {
68
69 waitAndClickById("UifCompView-Navigation4");
70
71
72 waitAndTypeByName("field50", "123.12");
73 fireEvent("field50", "blur");
74 try {
75 validateErrorImage(true);
76 fail("Framework error validateErrorImage(true) should have thrown an AssertionExcpetion");
77 } catch (AssertionError ae) {
78 jGrowl("validateErrorImage(true) when not expected okay.");
79
80 }
81 validateErrorImage(false);
82
83 clearTextByName("field50");
84 waitAndTypeByName("field50", "123.123");
85 fireEvent("field50", "blur");
86 try {
87 validateErrorImage(false);
88 fail("Framework error validateErrorImage(false) should have thrown an AssertionExcpetion");
89 } catch (AssertionError ae) {
90 jGrowl("validateErrorImage(false) when expected okay.");
91 }
92 validateErrorImage(true);
93
94 clearTextByName("field50");
95 waitAndTypeByXpath("//input[@name='field50']", "1234.4");
96 fireEvent("field50", "blur");
97 validateErrorImage(true);
98 clearTextByName("field50");
99 waitAndTypeByXpath("//input[@name='field50']", "1234.434");
100 fireEvent("field50", "blur");
101 validateErrorImage(true);
102 clearTextByName("field50");
103 waitAndTypeByXpath("//input[@name='field50']", "123.67");
104 fireEvent("field50", "blur");
105 validateErrorImage(false);
106 clearTextByName("field50");
107
108
109 waitAndTypeByXpath("//input[@name='field51']", "127.");
110 fireEvent("field51", "blur");
111 validateErrorImage(true);
112 clearTextByName("field51");
113 waitAndTypeByXpath("//input[@name='field51']", "1234()98");
114 fireEvent("field51", "blur");
115 validateErrorImage(true);
116 clearTextByName("field51");
117 waitAndTypeByXpath("//input[@name='field51']", "-123.67");
118 fireEvent("field51", "blur");
119 validateErrorImage(false);
120 clearTextByName("field51");
121
122
123 waitAndTypeByXpath("//input[@name='field77']", "127.");
124 fireEvent("field77", "blur");
125 validateErrorImage(true);
126 clearTextByName("field77");
127 waitAndTypeByXpath("//input[@name='field77']", "1234.4123");
128 fireEvent("field77", "blur");
129 validateErrorImage(true);
130 clearTextByName("field77");
131 waitAndTypeByXpath("//input[@name='field77']", "123E123");
132 fireEvent("field77", "blur");
133 validateErrorImage(true);
134 clearTextByName("field77");
135 waitAndTypeByXpath("//input[@name='field77']", "-123");
136 fireEvent("field77", "blur");
137 validateErrorImage(false);
138 clearTextByName("field77");
139
140
141 waitAndTypeByXpath("//input[@name='field52']", "1271231234");
142 fireEvent("field52", "blur");
143 validateErrorImage(true);
144 clearTextByName("field52");
145 waitAndTypeByXpath("//input[@name='field52']", "123-123-123");
146 fireEvent("field52", "blur");
147 validateErrorImage(true);
148 clearTextByName("field52");
149 waitAndTypeByXpath("//input[@name='field52']", "12-12-123445");
150 fireEvent("field52", "blur");
151 validateErrorImage(true);
152 clearTextByName("field52");
153 waitAndTypeByXpath("//input[@name='field52']", "1234-12-1234");
154 fireEvent("field52", "blur");
155 validateErrorImage(true);
156 clearTextByName("field52");
157 waitAndTypeByXpath("//input[@name='field52']", "123.123.1234");
158 fireEvent("field52", "blur");
159 validateErrorImage(true);
160 clearTextByName("field52");
161 waitAndTypeByXpath("//input[@name='field52']", "123-123-12345");
162 fireEvent("field52", "blur");
163 validateErrorImage(true);
164 clearTextByName("field52");
165 waitAndTypeByXpath("//input[@name='field52']", "123-123-1234");
166 fireEvent("field52", "blur");
167 validateErrorImage(false);
168 clearTextByName("field52");
169
170
171 waitAndTypeByXpath("//input[@name='field53']", "127");
172 fireEvent("field53", "blur");
173 validateErrorImage(true);
174 clearTextByName("field53");
175 waitAndTypeByXpath("//input[@name='field53']", "TestJava!@#Class");
176 fireEvent("field53", "blur");
177 validateErrorImage(true);
178 clearTextByName("field53");
179 waitAndTypeByXpath("//input[@name='field53']", "Test JavaClass");
180 fireEvent("field53", "blur");
181 validateErrorImage(true);
182 clearTextByName("field53");
183 waitAndTypeByXpath("//input[@name='field53']", "Test JavaClass");
184 fireEvent("field53", "blur");
185 validateErrorImage(true);
186 clearTextByName("field53");
187 waitAndTypeByXpath("//input[@name='field53']", "TestJavaClass");
188 fireEvent("field53", "blur");
189 validateErrorImage(false);
190 clearTextByName("field53");
191
192
193 waitAndTypeByXpath("//input[@name='field54']", "123@123.123");
194 fireEvent("field54", "blur");
195 validateErrorImage(true);
196 clearTextByName("field54");
197 waitAndTypeByXpath("//input[@name='field54']", "email.com@emailServer");
198 fireEvent("field54", "blur");
199 validateErrorImage(true);
200 clearTextByName("field54");
201 waitAndTypeByXpath("//input[@name='field54']", "emailemailServer@.com");
202 fireEvent("field54", "blur");
203 validateErrorImage(true);
204 clearTextByName("field54");
205 waitAndTypeByXpath("//input[@name='field54']", "email@emailServercom");
206 fireEvent("field54", "blur");
207 validateErrorImage(true);
208 clearTextByName("field54");
209 waitAndTypeByXpath("//input[@name='field54']", "email@emailServer.com");
210 fireEvent("field54", "blur");
211 validateErrorImage(false);
212 clearTextByName("field54");
213
214
215 waitAndTypeByXpath("//input[@name='field84']", "www.google.com");
216 fireEvent("field84", "blur");
217 validateErrorImage(true);
218 clearTextByName("field84");
219 waitAndTypeByXpath("//input[@name='field84']", "https:www.google.com");
220 fireEvent("field84", "blur");
221 validateErrorImage(true);
222 clearTextByName("field84");
223 waitAndTypeByXpath("//input[@name='field84']", "ftp://www.google.comsdfa123!#@");
224 fireEvent("field84", "blur");
225 validateErrorImage(true);
226 clearTextByName("field84");
227 waitAndTypeByXpath("//input[@name='field84']", "ftp:/www.google.coms");
228 fireEvent("field84", "blur");
229 validateErrorImage(true);
230 clearTextByName("field84");
231 waitAndTypeByXpath("//input[@name='field84']", "ftp://www.google.com");
232 fireEvent("field84", "blur");
233 validateErrorImage(false);
234 clearTextByName("field84");
235 waitAndTypeByXpath("//input[@name='field84']", "https://www.google.com");
236 fireEvent("field84", "blur");
237 validateErrorImage(false);
238 clearTextByName("field84");
239 waitAndTypeByXpath("//input[@name='field84']", "http://www.google.com");
240 fireEvent("field84", "blur");
241 validateErrorImage(false);
242 clearTextByName("field84");
243
244
245
246 waitAndTypeByXpath("//input[@name='field55']", "12/12/2112 12:12:87 am");
247 fireEvent("field55", "blur");
248 validateErrorImage(true);
249 clearTextByName("field55");
250 waitAndTypeByXpath("//input[@name='field55']", "12-12-2112 12:12 am");
251 fireEvent("field55", "blur");
252 validateErrorImage(true);
253 clearTextByName("field55");
254 waitAndTypeByXpath("//input[@name='field55']", "12-12-2112 12:12");
255 fireEvent("field55", "blur");
256 validateErrorImage(true);
257 clearTextByName("field55");
258 waitAndTypeByXpath("//input[@name='field55']", "12/12/2112 12:12");
259 fireEvent("field55", "blur");
260 validateErrorImage(true);
261 clearTextByName("field55");
262 waitAndTypeByXpath("//input[@name='field55']", "12-12-2112 12:12:78");
263 fireEvent("field55", "blur");
264 validateErrorImage(true);
265 clearTextByName("field55");
266 waitAndTypeByXpath("//input[@name='field55']", "12 Sept");
267 fireEvent("field55", "blur");
268 validateErrorImage(true);
269 clearTextByName("field55");
270 waitAndTypeByXpath("//input[@name='field55']", "Sept 12 12:12");
271 fireEvent("field55", "blur");
272 validateErrorImage(true);
273 clearTextByName("field55");
274 waitAndTypeByXpath("//input[@name='field55']", "221299 12:12:13");
275 fireEvent("field55", "blur");
276 validateErrorImage(true);
277 clearTextByName("field55");
278 waitAndTypeByXpath("//input[@name='field55']", "111222 12:12");
279 fireEvent("field55", "blur");
280 validateErrorImage(true);
281 clearTextByName("field55");
282 waitAndTypeByXpath("//input[@name='field55']", "9/9/2012 12:12 am");
283 fireEvent("field55", "blur");
284 validateErrorImage(true);
285 clearTextByName("field55");
286
287
288 waitAndTypeByXpath("//input[@name='field55']", "09/09/2012 12:12 pm");
289 fireEvent("field55", "blur");
290 validateErrorImage(false);
291 clearTextByName("field55");
292 waitAndTypeByXpath("//input[@name='field55']", "090923");
293 fireEvent("field55", "blur");
294 validateErrorImage(false);
295 clearTextByName("field55");
296 waitAndTypeByXpath("//input[@name='field55']", "Sept 12");
297 fireEvent("field55", "blur");
298 validateErrorImage(false);
299 clearTextByName("field55");
300 waitAndTypeByXpath("//input[@name='field55']", "2034");
301 fireEvent("field55", "blur");
302 validateErrorImage(false);
303 clearTextByName("field55");
304 waitAndTypeByXpath("//input[@name='field55']", "12/12/2012 23:12:59");
305 fireEvent("field55", "blur");
306 validateErrorImage(false);
307 clearTextByName("field55");
308 waitAndTypeByXpath("//input[@name='field55']", "12-12-12 23:12:59");
309 fireEvent("field55", "blur");
310 validateErrorImage(false);
311 clearTextByName("field55");
312 waitAndTypeByXpath("//input[@name='field55']", "121212 23:12:32");
313 fireEvent("field55", "blur");
314 validateErrorImage(false);
315 clearTextByName("field55");
316 waitAndTypeByXpath("//input[@name='field55']", "Sept 12 23:45:50");
317 fireEvent("field55", "blur");
318 validateErrorImage(false);
319 clearTextByName("field55");
320 waitAndTypeByXpath("//input[@name='field55']", "2011 12:23:32");
321 fireEvent("field55", "blur");
322 validateErrorImage(false);
323 clearTextByName("field55");
324
325
326 waitAndTypeByXpath("//input[@name='field75']", "12122012");
327 fireEvent("field75", "blur");
328 validateErrorImage(true);
329 clearTextByName("field75");
330 waitAndTypeByXpath("//input[@name='field75']", "13-12-34");
331 fireEvent("field75", "blur");
332 validateErrorImage(true);
333 clearTextByName("field75");
334 waitAndTypeByXpath("//input[@name='field75']", "12:12:2034");
335 fireEvent("field75", "blur");
336 validateErrorImage(true);
337 clearTextByName("field75");
338 waitAndTypeByXpath("//input[@name='field75']", "12-12-2034");
339 fireEvent("field75", "blur");
340 validateErrorImage(false);
341 clearTextByName("field75");
342
343
344 waitAndTypeByXpath("//input[@name='field82']", "13:00:12");
345 fireEvent("field82", "blur");
346 validateErrorImage(true);
347 clearTextByName("field82");
348 waitAndTypeByXpath("//input[@name='field82']", "09:00:");
349 fireEvent("field82", "blur");
350 validateErrorImage(true);
351 clearTextByName("field82");
352 waitAndTypeByXpath("//input[@name='field82']", "3-00:12");
353 fireEvent("field82", "blur");
354 validateErrorImage(true);
355 clearTextByName("field82");
356 waitAndTypeByXpath("//input[@name='field82']", "3:00:34");
357 fireEvent("field82", "blur");
358 validateErrorImage(false);
359 clearTextByName("field82");
360 waitAndTypeByXpath("//input[@name='field82']", "3:00");
361 fireEvent("field82", "blur");
362 validateErrorImage(false);
363 clearTextByName("field82");
364
365
366 waitAndTypeByXpath("//input[@name='field83']", "24:00:12");
367 fireEvent("field83", "blur");
368 validateErrorImage(true);
369 clearTextByName("field83");
370 waitAndTypeByXpath("//input[@name='field83']", "14:00:");
371 fireEvent("field83", "blur");
372 validateErrorImage(true);
373 clearTextByName("field83");
374 waitAndTypeByXpath("//input[@name='field83']", "13:00:76");
375 fireEvent("field83", "blur");
376 validateErrorImage(true);
377 clearTextByName("field83");
378 waitAndTypeByXpath("//input[@name='field83']", "13:00:23");
379 fireEvent("field83", "blur");
380 validateErrorImage(false);
381 clearTextByName("field83");
382 waitAndTypeByXpath("//input[@name='field83']", "23:00:12");
383 fireEvent("field83", "blur");
384 validateErrorImage(false);
385 clearTextByName("field83");
386
387
388 waitAndTypeByXpath("//input[@name='field56']", "1000-12-12 12:12:12.103");
389 fireEvent("field56", "blur");
390 validateErrorImage(true);
391 clearTextByName("field56");
392 waitAndTypeByXpath("//input[@name='field56']", "2000/12/12 12-12-12.87");
393 fireEvent("field56", "blur");
394 validateErrorImage(true);
395 clearTextByName("field56");
396 waitAndTypeByXpath("//input[@name='field56']", "2000/12/12 12-12-12.87");
397 fireEvent("field56", "blur");
398 validateErrorImage(true);
399 clearTextByName("field56");
400 waitAndTypeByXpath("//input[@name='field56']", "2011-08-12 12:12:12");
401 fireEvent("field56", "blur");
402 validateErrorImage(true);
403 clearTextByName("field56");
404
405
406
407
408
409
410
411
412
413 waitAndTypeByXpath("//input[@name='field56']", "2099-12-12 12:12:12.103");
414 fireEvent("field56", "blur");
415 validateErrorImage(false);
416 clearTextByName("field56");
417
418
419 waitAndTypeByXpath("//input[@name='field57']", "1599");
420 fireEvent("field57", "blur");
421 validateErrorImage(true);
422 clearTextByName("field57");
423 waitAndTypeByXpath("//input[@name='field57']", "2200");
424 fireEvent("field57", "blur");
425 validateErrorImage(true);
426 clearTextByName("field57");
427 waitAndTypeByXpath("//input[@name='field57']", "20000");
428 fireEvent("field57", "blur");
429 validateErrorImage(true);
430 clearTextByName("field57");
431 waitAndTypeByXpath("//input[@name='field57']", "-202");
432 fireEvent("field57", "blur");
433 validateErrorImage(true);
434 clearTextByName("field57");
435 waitAndTypeByXpath("//input[@name='field57']", "2000");
436 fireEvent("field57", "blur");
437 validateErrorImage(false);
438 clearTextByName("field57");
439
440
441 waitAndTypeByXpath("//input[@name='field58']", "0");
442 fireEvent("field58", "blur");
443 validateErrorImage(true);
444 clearTextByName("field58");
445 waitAndTypeByXpath("//input[@name='field58']", "-12");
446 fireEvent("field58", "blur");
447 validateErrorImage(true);
448 clearTextByName("field58");
449 waitAndTypeByXpath("//input[@name='field58']", "100");
450 fireEvent("field58", "blur");
451 validateErrorImage(true);
452 clearTextByName("field58");
453 waitAndTypeByXpath("//input[@name='field58']", "12");
454 fireEvent("field58", "blur");
455 validateErrorImage(false);
456 clearTextByName("field58");
457
458
459 waitAndTypeByXpath("//input[@name='field61']", "123");
460 fireEvent("field61", "blur");
461 validateErrorImage(true);
462 clearTextByName("field61");
463 waitAndTypeByXpath("//input[@name='field61']", "2341 12");
464 fireEvent("field61", "blur");
465 validateErrorImage(true);
466 clearTextByName("field61");
467 waitAndTypeByXpath("//input[@name='field61']", "0-1231");
468 fireEvent("field61", "blur");
469 validateErrorImage(true);
470 clearTextByName("field61");
471 waitAndTypeByXpath("//input[@name='field61']", "12345");
472 fireEvent("field61", "blur");
473 validateErrorImage(false);
474 clearTextByName("field61");
475
476
477 waitAndTypeByXpath("//input[@name='field62']", "123 23 @#");
478 fireEvent("field62", "blur");
479 validateErrorImage(true);
480 clearTextByName("field62");
481 waitAndTypeByXpath("//input[@name='field62']", "-asd123");
482 fireEvent("field62", "blur");
483 validateErrorImage(true);
484 clearTextByName("field62");
485 waitAndTypeByXpath("//input[@name='field62']", "asd/123");
486 fireEvent("field62", "blur");
487 validateErrorImage(true);
488 clearTextByName("field62");
489 waitAndTypeByXpath("//input[@name='field62']", "asd123");
490 fireEvent("field62", "blur");
491 validateErrorImage(false);
492 clearTextByName("field62");
493
494
495 waitAndTypeByXpath("//input[@name='field63']", "123^we");
496 fireEvent("field63", "blur");
497 validateErrorImage(true);
498 clearTextByName("field63");
499 waitAndTypeByXpath("//input[@name='field63']", "-123_asd");
500 fireEvent("field63", "blur");
501 validateErrorImage(true);
502 clearTextByName("field63");
503 waitAndTypeByXpath("//input[@name='field63']", "123 23 @#");
504 fireEvent("field63", "blur");
505 clearTextByName("field63");
506 waitAndTypeByXpath("//input[@name='field63']", "as_de 456/123");
507 fireEvent("field63", "blur");
508 validateErrorImage(false);
509 clearTextByName("field63");
510
511
512 waitAndTypeByXpath("//input[@name='field64']", "123^we");
513 fireEvent("field64", "blur");
514 validateErrorImage(true);
515 clearTextByName("field64");
516 waitAndTypeByXpath("//input[@name='field64']", "asd_pqr");
517 fireEvent("field64", "blur");
518 validateErrorImage(true);
519 clearTextByName("field64");
520 waitAndTypeByXpath("//input[@name='field64']", "asd/def");
521 fireEvent("field64", "blur");
522 validateErrorImage(true);
523 clearTextByName("field64");
524 waitAndTypeByXpath("//input[@name='field64']", "asd ,pqr");
525 fireEvent("field64", "blur");
526 validateErrorImage(false);
527 clearTextByName("field64");
528
529
530 waitAndTypeByXpath("//input[@name='field76']", "123");
531 fireEvent("field76", "blur");
532 validateErrorImage(true);
533 clearTextByName("field76");
534 waitAndTypeByXpath("//input[@name='field76']", "`abcd`");
535 fireEvent("field76", "blur");
536 validateErrorImage(true);
537 clearTextByName("field76");
538 waitAndTypeByXpath("//input[@name='field76']", "|abcd|");
539 fireEvent("field76", "blur");
540 validateErrorImage(true);
541 clearTextByName("field76");
542 waitAndTypeByXpath("//input[@name='field76']", "~abcd~");
543 fireEvent("field76", "blur");
544 validateErrorImage(true);
545 clearTextByName("field76");
546 waitAndTypeByXpath("//input[@name='field76']", " ab_c d_ef ");
547 fireEvent("field76", "blur");
548 validateErrorImage(false);
549 clearTextByName("field76");
550
551
552 waitAndTypeByXpath("//input[@name='field65']", "123 ^we");
553 fireEvent("field65", "blur");
554 validateErrorImage(true);
555 clearTextByName("field65");
556 waitAndTypeByXpath("//input[@name='field65']", "123^we!@#^&*~:");
557 fireEvent("field65", "blur");
558 validateErrorImage(false);
559 clearTextByName("field65");
560
561
562 waitAndTypeByXpath("//input[@name='field66']", "123 ^we");
563 fireEvent("field66", "blur");
564 validateErrorImage(true);
565 clearTextByName("field66");
566 waitAndTypeByXpath("//input[@name='field66']", "123_^we");
567 fireEvent("field66", "blur");
568 validateErrorImage(true);
569 clearTextByName("field66");
570 waitAndTypeByXpath("//input[@name='field66']", "abc ABC");
571 fireEvent("field66", "blur");
572 validateErrorImage(true);
573 clearTextByName("field66");
574 waitAndTypeByXpath("//input[@name='field66']", "aAbBcC");
575 fireEvent("field66", "blur");
576 validateErrorImage(false);
577 clearTextByName("field66");
578
579
580 waitAndTypeByXpath("//input[@name='field67']", "123 ^we");
581 fireEvent("field67", "blur");
582 validateErrorImage(true);
583 clearTextByName("field67");
584 waitAndTypeByXpath("//input[@name='field67']", "123/10");
585 fireEvent("field67", "blur");
586 validateErrorImage(true);
587 clearTextByName("field67");
588 waitAndTypeByXpath("//input[@name='field67']", "(123.00)");
589 fireEvent("field67", "blur");
590 validateErrorImage(true);
591 clearTextByName("field67");
592 waitAndTypeByXpath("//input[@name='field67']", "(12-3)");
593 fireEvent("field67", "blur");
594 validateErrorImage(false);
595 clearTextByName("field67");
596
597
598 waitAndTypeByXpath("//input[@name='field68']", "123.123");
599 fireEvent("field68", "blur");
600 validateErrorImage(true);
601 clearTextByName("field68");
602 waitAndTypeByXpath("//input[@name='field68']", "a.b");
603 fireEvent("field68", "blur");
604 validateErrorImage(true);
605 clearTextByName("field68");
606 waitAndTypeByXpath("//input[@name='field68']", "123 qwe");
607 fireEvent("field68", "blur");
608 validateErrorImage(true);
609 clearTextByName("field68");
610 waitAndTypeByXpath("//input[@name='field68']", "5.a");
611 fireEvent("field68", "blur");
612 validateErrorImage(true);
613 clearTextByName("field68");
614 waitAndTypeByXpath("//input[@name='field68']", "a.0,b.4");
615 fireEvent("field68", "blur");
616 validateErrorImage(true);
617 clearTextByName("field68");
618 waitAndTypeByXpath("//input[@name='field68']", "a.0");
619 fireEvent("field68", "blur");
620 validateErrorImage(false);
621 clearTextByName("field68");
622 passed();
623 }
624 }