1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.demo.travel.account.inquiry;
17
18 import edu.samplu.common.Failable;
19 import edu.samplu.common.ITUtil;
20 import edu.samplu.common.WebDriverLegacyITBase;
21
22
23
24
25 public abstract class DemoTravelAccountInquirySmokeTestBase extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String ANCHOR_TITLE_TRAVEL_ACCOUNT = "//a[@title='Travel Account ']";
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.account.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 getTestUrl() {
49 return ITUtil.KRAD_PORTAL;
50 }
51
52 protected void navigation() throws Exception {
53 waitAndClickById("Demo-DemoLink", "");
54 waitAndClickByLinkText("Account Inquiry");
55 }
56
57 protected void testInquiryBackButton() throws Exception {
58 waitAndClickButtonByText("Back");
59 waitForElementPresentByClassName("uif-headerText");
60 assertTextPresent("Demo - Travel Application");
61 }
62
63 public void testInquiryBackButtonBookmark(Failable failable) throws Exception {
64 testInquiryBackButton();
65 passed();
66 }
67
68 public void testInquiryBackButtonNav(Failable failable) throws Exception {
69 navigation();
70 testInquiryBackButton();
71 passed();
72 }
73
74 protected void testCollapseExpand() throws InterruptedException {
75 assertTextPresent("Travel Account Number:");
76 assertTextPresent(EXPAND_ALL);
77 assertTextPresent(COLLAPSE_ALL);
78 assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, "");
79
80 waitAndClickButtonByText(COLLAPSE_ALL);
81 assertIsNotVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, " after clicking " + COLLAPSE_ALL);
82
83 waitAndClickButtonByText(EXPAND_ALL);
84 assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, " after clicking " + EXPAND_ALL);
85 }
86
87 public void testInquiryCollapseExpandBookmark(Failable failable) throws Exception {
88 testCollapseExpand();
89 passed();
90 }
91
92 public void testInquiryCollapseExpandNav(Failable failable) throws Exception {
93 navigation();
94 testCollapseExpand();
95 passed();
96 }
97
98 protected void testInquiryLightBox() throws Exception {
99 waitAndClickByLinkText("a6");
100 assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, "");
101 }
102
103 public void testInquiryLightBoxBookmark(Failable failable) throws Exception {
104 testInquiryLightBox();
105 passed();
106 }
107
108 public void testInquiryLightBoxNav(Failable failable) throws Exception {
109 navigation();
110 testInquiryLightBox();
111 passed();
112 }
113 }