1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.kitchensink;
17
18 import com.thoughtworks.selenium.SeleneseTestBase;
19 import org.junit.Test;
20 import org.kuali.rice.testtools.common.JiraAwareFailable;
21 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
22
23
24
25
26
27
28 public class LabsDirtyFieldsAft extends LabsKitchenSinkBase {
29
30
31
32
33 public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&pageId=UifCompView-Page1";
34
35 @Override
36 protected String getBookmarkUrl() {
37 return BOOKMARK_URL;
38 }
39
40 @Override
41 protected void navigate() throws Exception {
42 navigateToKitchenSink("Input Fields");
43 }
44
45 @Test
46 public void testDirtyFieldsCheckBookmark() throws Exception {
47 testDirtyFieldsCheck();
48 passed();
49 }
50
51 @Test
52 public void testDirtyFieldsCheckNav() throws Exception {
53 testDirtyFieldsCheck();
54 passed();
55 }
56
57 protected void testDirtyFieldsCheck() throws Exception {
58 waitForPageToLoad();
59
60 waitAndTypeByName("field1", "test 1");
61 waitAndTypeByName("field102", "test 2");
62 assertCancelConfirmation();
63
64
65 waitForElementPresentByName("field100");
66 waitAndTypeByName("field100", "here");
67 waitAndTypeByName("field103", "there");
68
69
70 assertCancelConfirmation();
71
72
73 waitForElementPresentByName("field106");
74
75
76
77 assertTrue(waitAndGetAttributeByName("field112", "style").contains("text-transform: uppercase;"));
78 assertCancelConfirmation();
79 waitForElementPresentByName("field101");
80 assertEquals("val", waitAndGetAttributeByName("field101", "value"));
81 clearTextByName("field101");
82 waitAndTypeByName("field101", "1");
83 waitAndTypeByName("field104", "");
84 SeleneseTestBase.assertEquals("1", waitAndGetAttributeByName("field101", "value"));
85 waitAndTypeByName("field104", "2");
86
87
88 assertCancelConfirmation();
89 }
90
91 private void assertCancelConfirmation() throws InterruptedException {
92 waitAndClickCancelByText();
93 alertDismiss();
94 }
95
96 }