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.testtools.selenium.WebDriverLegacyITBase;
19 import org.junit.Test;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class DemoTravelAccountLookUpAutoSearchAft extends WebDriverLegacyITBase {
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 waitAndClickById("Demo-DemoLink", "");
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 @Test
74 public void testDemoTravelAccountLookUpAutoSearchNav() throws Exception {
75 testDemoTravelAccountLookUpAutoSearch();
76 passed();
77 }
78
79 @Test
80 public void testDemoTravelAccountLookUpAutoSearchBookmark() throws Exception {
81 testDemoTravelAccountLookUpAutoSearch();
82 passed();
83 }
84
85 private void waitSearchAndReturnFromLightbox() throws Exception {
86 gotoLightBox();
87 waitAndClickButtonByText("Search");
88 waitAndClickByLinkText("return value");
89 }
90 }