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.junit.Test;
19
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21 import org.openqa.selenium.By;
22
23
24
25
26 public class LibraryValidationAlphaConstraintsAft extends WebDriverLegacyITBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-AlphaPatternConstraintView&methodToCall=start";
32
33
34
35
36 private static final String ERROR_MSG= " Can only be alpha characters, whitespace, newlines, periods, parentheses, forward slashes, double quotes, apostrophes, colons, semi-colons, question marks, exclaimation marks, dashes";
37
38 @Override
39 protected String getBookmarkUrl() {
40 return BOOKMARK_URL;
41 }
42
43 @Override
44 protected void navigate() throws Exception {
45 waitAndClickLibraryLink();
46 waitAndClickByLinkText("Validation");
47 waitAndClickByLinkText("Alpha Constraint");
48 }
49
50 protected void testValidationAlphaConstraints() throws Exception {
51
52 assertFocusTypeTabError("inputField1", "12");
53 }
54
55 protected void testValidationAlphaConstraintsFlags() throws Exception {
56 waitAndClickByLinkText("Flags");
57
58
59 assertFocusTypeTabError("inputField2", "1 2");
60 assertFocusTypeTabError("inputField3", "1,2");
61 }
62
63 protected void testValidationAlphaConstraintsPreconfiguredBeans() throws Exception {
64 waitAndClickByLinkText("Preconfigured Bean(s)");
65
66
67 waitAndTypeByName("inputField4","as=-0");
68 typeTab();
69 fireMouseOverEventByName("inputField4");
70 assertTextPresent(ERROR_MSG);
71 }
72
73 @Test
74 public void testValidationAlphaConstraintsBookmark() throws Exception {
75 testValidationAlphaConstraints();
76 testValidationAlphaConstraintsFlags();
77 testValidationAlphaConstraintsPreconfiguredBeans();
78 passed();
79 }
80
81 @Test
82 public void testValidationAlphaConstraintsNav() throws Exception {
83 testValidationAlphaConstraints();
84 testValidationAlphaConstraintsFlags();
85 testValidationAlphaConstraintsPreconfiguredBeans();
86 passed();
87 }
88 }