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