1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.travel;
17
18 import com.thoughtworks.selenium.SeleneseTestBase;
19 import org.kuali.rice.testtools.common.JiraAwareFailable;
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21
22
23
24
25
26
27 public abstract class DirtyFieldsAftBase extends WebDriverLegacyITBase {
28
29
30
31
32 public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&readOnlyFields=field91";
33
34 @Override
35 protected String getBookmarkUrl() {
36 return BOOKMARK_URL;
37 }
38
39 protected void navigation() throws InterruptedException {
40 waitAndClickKRAD();
41 waitAndClickByLinkText(UIF_COMPONENTS_KITCHEN_SINK_LINK_TEXT);
42 switchToWindow(KUALI_UIF_COMPONENTS_WINDOW_XPATH);
43 }
44
45 protected void testDirtyFieldsCheckNav(JiraAwareFailable failable) throws Exception {
46 navigation();
47 testDirtyFieldsCheck();
48 passed();
49 }
50
51 protected void testDirtyFieldsCheckBookmark(JiraAwareFailable failable) throws Exception {
52 testDirtyFieldsCheck();
53 passed();
54 }
55
56
57 protected void testDirtyFieldsCheck() throws Exception {
58 checkForIncidentReport(getTestUrl());
59 waitAndClickByLinkText("Text Controls");
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 SeleneseTestBase.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 }