1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.validation;
17
18 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
19 import org.junit.Test;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class DemoValidationAlphaNumericConstraintsAft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-AlphaNumericPatternConstraintView&methodToCall=start";
31
32
33
34
35 private static final String ERROR_MSG= " Can only be alphanumeric characters, whitespace, newlines, periods, parentheses, forward slashes, double quotes, apostrophes, colons, semi-colons, question marks, exclaimation marks, dashes ";
36
37 @Override
38 protected String getBookmarkUrl() {
39 return BOOKMARK_URL;
40 }
41
42 @Override
43 protected void navigate() throws Exception {
44 waitAndClickById("Demo-LibraryLink", "");
45 waitAndClickByLinkText("Validation");
46 waitAndClickByLinkText("AlphaNumeric Constraint");
47 }
48
49 protected void testValidationAlphaNumericConstraints() throws Exception {
50
51 waitAndTypeByName("inputField1","_as");
52 waitAndClickLinkContainingText("Library Navigation");
53 fireMouseOverEventByName("inputField1");
54 isVisible(By.xpath("//div[@class='uif-clientMessageItems uif-clientErrorDiv']"));
55 }
56
57 protected void testValidationAlphaNumericConstraintsFlags() throws Exception {
58 waitAndClickByLinkText("Flags");
59
60
61 waitAndTypeByName("inputField2","as 1_4");
62 waitAndTypeByName("inputField3","a_s");
63 isVisible(By.xpath("//li[@class='uif-errorMessageItem-field']"));
64 waitAndTypeByName("inputField2","");
65 isNotVisible(By.xpath("//li[@class='uif-errorMessageItem-field']"));
66 }
67
68 protected void testValidationAlphaNumericConstraintsPreconfiguredBeans() throws Exception {
69 waitAndClickByLinkText("Preconfigured Bean(s)");
70
71
72 waitAndTypeByName("inputField4","as#");
73 waitAndClickLinkContainingText("Library Navigation");
74 fireMouseOverEventByName("inputField4");
75 isVisible(By.xpath("//li[@class='uif-errorMessageItem-field']"));
76 }
77
78 @Test
79 public void testValidationAlphaNumericConstraintsBookmark() throws Exception {
80 testValidationAlphaNumericConstraints();
81 testValidationAlphaNumericConstraintsFlags();
82 testValidationAlphaNumericConstraintsPreconfiguredBeans();
83 passed();
84 }
85
86 @Test
87 public void testValidationAlphaNumericConstraintsNav() throws Exception {
88 testValidationAlphaNumericConstraints();
89 testValidationAlphaNumericConstraintsFlags();
90 testValidationAlphaNumericConstraintsPreconfiguredBeans();
91 passed();
92 }
93 }