1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.demo.travel.account;
17
18 import edu.samplu.common.SmokeTestBase;
19 import org.junit.Test;
20
21
22
23
24 public class DemoTravelAccountInquirySmokeTest extends SmokeTestBase {
25
26
27
28
29 public static final String ANCHOR_TITLE_TRAVEL_ACCOUNT = "//a[@title='Travel Account ']";
30
31
32
33
34 public static final String BOOKMARK_URL = "/kr-krad/inquiry?methodToCall=start&number=a14&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount";
35
36
37
38
39 public static final String COLLAPSE_ALL = "Collapse All";
40
41
42
43
44 public static final String EXPAND_ALL = "Expand All";
45
46 @Override
47 public String getBookmarkUrl() {
48 return BOOKMARK_URL;
49 }
50
51 @Override
52 protected void navigate() throws Exception {
53 waitAndClickById("Demo-DemoLink", "");
54 waitAndClickByLinkText("Account Inquiry");
55 }
56
57 protected void testInquiryBackButton() throws Exception {
58 waitAndClickButtonByText("Back");
59 Thread.sleep(2000);
60 waitForElementPresentByXpath("//a[contains(text(), 'Account Inquiry')]");
61 assertTextPresent("Demo - Travel Application", "Expected Demo - Travel Application did back work?");
62 }
63
64 protected void testInquiryBackToLoginButton() throws Exception {
65 waitAndClickButtonByText("Back");
66 Thread.sleep(2000);
67 waitForElementPresentById("Rice-LoginButton", "Expected Login - Travel Application Bookmark back work?");
68 }
69
70 protected void testCollapseExpand() throws InterruptedException {
71 waitForElementPresentByClassName("demo-contactInfo");
72 assertTextPresent("Travel Account Number:");
73 assertTextPresent(EXPAND_ALL);
74 assertTextPresent(COLLAPSE_ALL);
75 assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, "");
76
77 waitAndClickButtonByText(COLLAPSE_ALL);
78 assertIsNotVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, " after clicking " + COLLAPSE_ALL);
79
80 waitAndClickButtonByText(EXPAND_ALL);
81 assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, " after clicking " + EXPAND_ALL);
82 }
83
84 protected void testInquiryLightBox() throws Exception {
85 waitAndClickByLinkText("a6");
86 assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, "");
87 }
88
89 @Test
90 public void testInquiryCollapseExpandBookmark() throws Exception {
91 testCollapseExpand();
92 passed();
93 }
94
95 @Test
96 public void testInquiryLightBoxBookmark() throws Exception {
97 testInquiryLightBox();
98 passed();
99 }
100
101 @Test
102 public void testInquiryBackButtonBookmark() throws Exception {
103 testInquiryBackToLoginButton();
104 passed();
105 }
106
107 @Test
108 public void testInquiryCollapseExpandNav() throws Exception {
109 testCollapseExpand();
110 passed();
111 }
112
113 @Test
114 public void testInquiryLightBoxNav() throws Exception {
115 testInquiryLightBox();
116 passed();
117 }
118
119 @Test
120 public void testInquiryBackButtonNav() throws Exception {
121 testInquiryBackButton();
122 passed();
123 }
124 }