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