1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.labs.clientside.stateview;
17
18 import org.junit.Test;
19 import org.junit.Assert;
20 import edu.samplu.common.SmokeTestBase;
21
22
23
24
25 public class ClientSideStateViewSmokeTest extends SmokeTestBase {
26
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-ClientSideState&formKey=ff000d97-13e9-4130-81a3-bc0217e8e0eb&cacheKey=otutyty24mo0f76n59ebqxvtpg&pageId=Lab-ClientSideState-Page1";
32
33
34
35
36 private static final String ACTIVE_COMPONENT_NAME = "inactivatableCollection[0].active";
37
38
39
40
41 private static final String ACTIVE_COMPONENT2_NAME = "inactivatableCollection2[0].active";
42
43
44
45
46 private static final String AJAX_BUTTON_XPATH = "//div[4]/div[2]/button";
47
48
49
50
51 private static final String SUBMIT_BUTTON_XPATH = "//div[4]/div[2]/button[2]";
52
53
54
55
56
57
58 @Override
59 protected void navigate() throws Exception {
60
61
62 }
63
64 @Override
65 protected String getBookmarkUrl() {
66 return BOOKMARK_URL;
67 }
68
69 @Test
70 public void testClientSideStateViewBookmark() throws Exception {
71 testClientSideStateView();
72 }
73
74 public void testClientSideStateView() throws Exception
75 {
76 selectFrameIframePortlet();
77 waitAndClickByName(ACTIVE_COMPONENT_NAME);
78 waitAndClickByName(ACTIVE_COMPONENT2_NAME);
79 waitAndClickByXpath(AJAX_BUTTON_XPATH);
80 Thread.sleep(5000);
81 Assert.assertFalse(isElementPresentByName(ACTIVE_COMPONENT_NAME));
82 Assert.assertFalse(isElementPresentByName(ACTIVE_COMPONENT2_NAME));
83 waitAndClickByXpath(SUBMIT_BUTTON_XPATH);
84 Thread.sleep(5000);
85 Assert.assertFalse(isElementPresentByName(ACTIVE_COMPONENT_NAME));
86 Assert.assertFalse(isElementPresentByName(ACTIVE_COMPONENT2_NAME));
87 }
88 }