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 LibraryValidationDatePatternConstraintsAft extends WebDriverLegacyITBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-DatePatternConstraintView&methodToCall=start";
32
33 @Override
34 protected String getBookmarkUrl() {
35 return BOOKMARK_URL;
36 }
37
38 @Override
39 protected void navigate() throws Exception {
40 waitAndClickLibraryLink();
41 waitAndClickByLinkText("Validation");
42 waitAndClickByLinkText("Date Constraint");
43 }
44
45 protected void testValidationDatePatternConstraints() throws Exception {
46 waitAndClickByLinkText("Default");
47
48
49 assertFocusTypeBlurError("inputField1","2 June 2012");
50 }
51
52 protected void testValidationDatePatternConstraintsBasicDate() throws Exception {
53 waitAndClickByLinkText("Basic Date");
54
55
56 waitAndTypeByName("inputField3","07/2/13");
57 waitAndTypeByName("inputField2","2 July 2013");
58 isNotVisible(By.xpath("//div[@class='uif-clientMessageItems uif-clientErrorDiv']"));
59 waitAndTypeByName("inputField2","");
60 isVisible(By.xpath("//div[@class='uif-clientMessageItems uif-clientErrorDiv']"));
61 }
62
63 protected void testValidationDatePatternCustomize() throws Exception {
64 waitAndClickByLinkText("Customize");
65
66
67 waitAndTypeByName("inputField4","23/12/13");
68 typeTab();
69 isVisible(By.xpath("//div[@class='uif-clientMessageItems uif-clientErrorDiv']"));
70 }
71
72 @Test
73 public void testValidationDatePatternConstraintsBookmark() throws Exception {
74 testValidationDatePatternConstraints();
75 testValidationDatePatternConstraintsBasicDate();
76 testValidationDatePatternCustomize();
77 passed();
78 }
79
80 @Test
81 public void testValidationDatePatternConstraintsNav() throws Exception {
82 testValidationDatePatternConstraints();
83 testValidationDatePatternConstraintsBasicDate();
84 testValidationDatePatternCustomize();
85 passed();
86 }
87 }