1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.travel.account;
17
18 import org.kuali.rice.krad.demo.ViewDemoAftBase;
19 import org.junit.Test;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class DemoTravelAccountLookUpAutoSearchAft extends ViewDemoAftBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=search&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&lookupCriteria['number']=a*&readOnlyFields=number&hideReturnLink=true&showMaintenanceLinks=true";
31
32
33
34
35 public static final String SEARCH = "Search";
36
37
38
39
40 public static final String CLEAR_VALUES = "Clear Values";
41
42 @Override
43 public String getBookmarkUrl() {
44 return BOOKMARK_URL;
45 }
46
47 public void navigate() throws Exception {
48 waitAndClickDemoLink();
49 waitAndClickByLinkText("Account Lookup Auto Search Pre-Filtered");
50 }
51
52 protected void testDemoTravelAccountLookUpAutoSearch() throws Exception {
53 waitForTextPresent("Showing 1 to 10");
54
55 By[] results = {By.linkText("a1"), By.linkText("a2"), By.linkText("a3"), By.linkText("a4"), By.linkText("a5"),
56 By.linkText("a6"), By.linkText("a7"), By.linkText("a8"), By.linkText("a9"), By.linkText("a10"),
57 By.linkText("a11"), By.linkText("a12"), By.linkText("a13"), By.linkText("a14")};
58
59 assertElementsPresentInResultPages(results);
60 waitAndClickByXpath("//div[@data-label='Travel Account Type Code']/div/div/button[@class='btn btn-default uif-action icon-search']");
61 waitSearchAndReturnFromLightbox();
62
63
64
65
66
67
68
69
70
71 }
72
73 protected void testDemoTravelAccountLookUpAdditionalSearch() throws Exception {
74 waitForTextPresent("Showing 1 to 10");
75
76 By[] results = {By.linkText("a1"), By.linkText("a2"), By.linkText("a3"), By.linkText("a4"), By.linkText("a5"),
77 By.linkText("a6"), By.linkText("a7"), By.linkText("a8"), By.linkText("a9"), By.linkText("a10"),
78 By.linkText("a11"), By.linkText("a12"), By.linkText("a13"), By.linkText("a14")};
79
80 assertElementsPresentInResultPages(results);
81 waitAndClickButtonByText(SEARCH);
82 checkForIncidentReport();
83 }
84
85 @Test
86 public void testDemoTravelAccountLookUpAutoSearchNav() throws Exception {
87 testDemoTravelAccountLookUpAutoSearch();
88 passed();
89 }
90
91 @Test
92 public void testDemoTravelAccountLookUpAutoSearchBookmark() throws Exception {
93 testDemoTravelAccountLookUpAutoSearch();
94 passed();
95 }
96
97 @Test
98 public void testDemoTravelAccountLookUpAdditionalBookmark() throws Exception {
99 testDemoTravelAccountLookUpAdditionalSearch();
100 passed();
101 }
102
103
104 private void waitSearchAndReturnFromLightbox() throws Exception {
105 gotoLightBox();
106 waitAndClickButtonByText("Search");
107 waitAndClickByLinkText("return value");
108 }
109 }