1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.krad.compview;
17
18 import org.kuali.rice.testtools.common.JiraAwareFailable;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20
21 import static org.junit.Assert.assertNotSame;
22
23
24
25
26
27
28 public abstract class DeleteSubCollectionLineAftBase extends WebDriverLegacyITBase {
29
30
31
32
33 public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&readOnlyFields=field91";
34
35
36
37
38 public static final String FIELD_ELEMENT_NAME = "list4[0].subList[0].field1";
39
40 @Override
41 protected String getBookmarkUrl() {
42 return BOOKMARK_URL;
43 }
44
45 protected void navigation() throws Exception {
46 waitAndClickKRAD();
47 waitAndClickByXpath(KITCHEN_SINK_XPATH);
48 switchToWindow(KUALI_UIF_COMPONENTS_WINDOW_XPATH);
49 }
50
51 protected void testDeleteSubCollectionLineNav(JiraAwareFailable failable) throws Exception {
52 navigation();
53 testDeleteSubCollectionLine();
54 passed();
55 }
56
57 protected void testDeleteSubCollectionLineBookmark(JiraAwareFailable failable) throws Exception {
58 testDeleteSubCollectionLine();
59 passed();
60 }
61
62 protected void testDeleteSubCollectionLine() throws Exception {
63
64 waitAndClickByLinkText(COLLECTIONS_LINK_TEXT);
65 Thread.sleep(5000);
66
67
68 waitForElementPresentByName(FIELD_ELEMENT_NAME);
69
70
71 waitAndTypeByName(FIELD_ELEMENT_NAME, "selenium");
72
73
74 waitAndClickById("subCollection1_line0_del_line0_line0");
75 Thread.sleep(2000);
76
77
78 for (int second = 0;; second++) {
79 if (second >= waitSeconds)fail(TIMEOUT_MESSAGE);
80
81 try {
82 if (!"selenium".equals(waitAndGetAttributeByName(FIELD_ELEMENT_NAME, "value")))
83 break;
84 } catch (Exception e) {}
85
86 Thread.sleep(1000);
87 }
88
89
90 assertNotSame("selenium", waitAndGetAttributeByName(FIELD_ELEMENT_NAME, "value"));
91 }
92 }