1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.travel;
17
18 import org.kuali.rice.testtools.common.JiraAwareFailable;
19 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21 import org.kuali.rice.testtools.selenium.WebDriverUtils;
22
23
24
25
26 public abstract class TravelAccountTypeLookupAftBase extends WebDriverLegacyITBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/portal.do?channelTitle=Travel%20Account%20Type%20Lookup&channelUrl="
32 + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD
33 + "edu.sampleu.travel.bo.TravelAccountType";
34
35
36
37
38 public static final String SEARCH_BUTTON_XPATH ="//*[contains(button,\"earch\")]/button";
39
40 protected String getDataTableTrTd1ContainsXpath(String contains) {
41 return "//table[@class='uif-tableCollectionLayout dataTable']//tr[contains(td[1],'" + contains + "')]";
42 }
43
44 protected String getBookmarkUrl() {
45 return BOOKMARK_URL;
46 }
47
48 protected void navigation() throws Exception {
49 waitAndClickByLinkText("KRAD");
50 waitAndClickByLinkText("Travel Account Type Lookup");
51 }
52
53 protected void testTravelAccountTypeLookupNav(JiraAwareFailable failable) throws Exception {
54 navigation();
55 testTravelAccountTypeLookup();
56 passed();
57 }
58
59 protected void testTravelAccountTypeLookupBookmark(JiraAwareFailable failable) throws Exception {
60 testTravelAccountTypeLookup();
61 passed();
62 }
63
64 protected void testTravelAccountTypeLookup() throws Exception {
65 selectFrameIframePortlet();
66
67
68 waitAndClickByXpath(SEARCH_BUTTON_XPATH + "[1]");
69 Thread.sleep(4000);
70 assertElementPresentByXpath(getDataTableTrTd1ContainsXpath("CAT"));
71 assertElementPresentByXpath(getDataTableTrTd1ContainsXpath("EAT"));
72 assertElementPresentByXpath(getDataTableTrTd1ContainsXpath("IAT"));
73
74
75 waitAndTypeByName("lookupCriteria[accountTypeCode]", "CAT");
76 waitAndClickByXpath(SEARCH_BUTTON_XPATH + "[1]");
77 Thread.sleep(2000);
78 assertElementPresentByXpath(getDataTableTrTd1ContainsXpath("CAT"));
79 waitAndClickByXpath(SEARCH_BUTTON_XPATH + "[2]");
80 Thread.sleep(2000);
81 waitAndTypeByName("lookupCriteria[name]", "Expense Account Type");
82 waitAndClickByXpath(SEARCH_BUTTON_XPATH + "[1]");
83 Thread.sleep(4000);
84 assertElementPresentByXpath(getDataTableTrTd1ContainsXpath("EAT"));
85
86
87 }
88 }