1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.samplu.travel.krad.test;
18
19 import edu.samplu.common.ITUtil;
20 import org.junit.Test;
21
22 import static junit.framework.Assert.assertEquals;
23 import static junit.framework.Assert.assertTrue;
24 import static junit.framework.Assert.fail;
25 import edu.samplu.common.WebDriverITBase;
26
27
28
29
30
31
32 public class DirtyFieldsCheckIT extends WebDriverITBase {
33 @Override
34 public String getTestUrl() {
35
36 return "/kr-krad/uicomponents?viewId=UifCompView_KNS&methodToCall=start&readOnlyFields=field91";
37 }
38
39 @Test
40 public void testDirtyFieldsCheck() throws Exception {
41 checkForIncidentReport(getTestUrl());
42 Thread.sleep(5000);
43
44 waitAndTypeByName("field1", "test 1");
45 waitAndTypeByName("field102", "test 2");
46
47 assertCancelConfirmation();
48
49
50 waitForElementPresentByName("field100");
51 waitAndTypeByName("field100", "here");
52 waitAndTypeByName("field103", "there");
53
54
55 assertCancelConfirmation();
56
57
58 waitForElementPresentByName("field106");
59
60
61 assertEquals("text-transform: uppercase;",getAttributeByName("field112", "style"));
62 assertCancelConfirmation();
63 waitForElementPresentByName("field101");
64 assertEquals("val", getAttributeByName("field101","value"));
65 clearTextByName("field101");
66 waitAndTypeByName("field101", "1");
67 waitAndTypeByName("field104", "");
68
69 assertEquals("1", getAttributeByName("field101","value"));
70 waitAndTypeByName("field104", "2");
71
72 assertCancelConfirmation();
73
74 }
75
76 private void assertCancelConfirmation() throws InterruptedException {
77 waitAndClickByLinkText("Cancel");
78 dismissAlert();
79 }
80 }