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 DemoValidationSimpleConstraintsAft extends WebDriverLegacyITBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-SimpleConstraintView&methodToCall=start";
32
33 @Override
34 protected String getBookmarkUrl() {
35 return BOOKMARK_URL;
36 }
37
38 @Override
39 protected void navigate() throws Exception {
40 waitAndClickById("Demo-LibraryLink", "");
41 waitAndClickByLinkText("Validation");
42 waitAndClickByLinkText("Simple Constraints");
43 }
44
45 protected void testValidationSimpleConstraintsRequired() throws Exception {
46 waitAndClickByLinkText("Required");
47
48 assertFocusTypeBlurError("inputField1", "");
49 assertFocusTypeBlurError("inputField2", "");
50 assertFocusTypeBlurError("inputField3", "");
51 }
52
53 protected void testValidationSimpleConstraintsMinMaxLength() throws Exception {
54 waitAndClickByLinkText("Min/Max Length");
55
56 waitAndTypeByName("inputField4","deepmoteria");
57 Thread.sleep(1000);
58 assertEquals("deepm", findElement(By.name("inputField4")).getAttribute("value"));
59 assertFocusTypeBlurError("inputField5", "de");
60 }
61
62 protected void testValidationSimpleConstraintsMinMaxValue() throws Exception {
63 waitAndClickByLinkText("Min/Max Value");
64
65 assertFocusTypeBlurError("inputField6","21");
66 assertFocusTypeBlurError("inputField7","2");
67 }
68
69 @Test
70 public void testValidationSimpleConstraintsBookmark() throws Exception {
71 testValidationSimpleConstraintsRequired();
72 testValidationSimpleConstraintsMinMaxLength();
73 testValidationSimpleConstraintsMinMaxValue();
74 passed();
75 }
76
77 @Test
78 public void testValidationSimpleConstraintsNav() throws Exception {
79 testValidationSimpleConstraintsRequired();
80 testValidationSimpleConstraintsMinMaxLength();
81 testValidationSimpleConstraintsMinMaxValue();
82 passed();
83 }
84 }