1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.travel.application;
17
18 import org.kuali.rice.krad.demo.ViewDemoAftBase;
19 import org.junit.Test;
20
21
22
23
24 public class DemoTravelCompanyLookUpAft extends ViewDemoAftBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&dataObjectClassName=edu.sampleu.travel.dataobject.TravelCompany";
30
31
32
33
34 public static final String SEARCH = "Search";
35
36
37
38
39 public static final String CLEAR_VALUES = "Clear Values";
40
41
42
43
44 public static final String TRAVEL_COMPANY_ID = "lookupCriteria[travelCompanyId]";
45
46
47
48
49 public static final String TRAVEL_COMPANY_NAME = "lookupCriteria[travelCompanyName]";
50
51 @Override
52 public String getBookmarkUrl() {
53 return BOOKMARK_URL;
54 }
55
56 @Override
57 protected void navigate() throws Exception {
58 waitAndClickDemoLink();
59 waitAndClickByLinkText("Travel Company Lookup");
60 }
61
62 protected void testTravelCompanyLookUp() throws Exception {
63 waitAndTypeByName(TRAVEL_COMPANY_ID,"1");
64 waitAndTypeByName(TRAVEL_COMPANY_NAME,"a*");
65 waitAndClickButtonByText(SEARCH);
66 waitForTextPresent("No values match this search.");
67 waitForTextPresent("You have entered the primary key for this table (Id) in the search criteria. Since these fields can be used to uniquely identify a row in this table, the other search criteria entered will be ignored.");
68 waitAndClickButtonByText(CLEAR_VALUES);
69 waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='Y']");
70 waitAndClickButtonByText(SEARCH);
71 String activeResults [] ={"10000","Value Rentals","true"};
72 Thread.sleep(1000);
73 assertTextPresent(activeResults);
74 waitAndClickButtonByText(CLEAR_VALUES);
75 waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
76 waitAndClickButtonByText(SEARCH);
77 String activeResultsNo [] ={"10001","AAA Travel","false"};
78 Thread.sleep(1000);
79 assertTextPresent(activeResultsNo);
80 }
81
82 @Test
83 public void testTravelCompanyLookUpBookmark() throws Exception {
84 testTravelCompanyLookUp();
85 passed();
86 }
87
88 @Test
89 public void testTravelCompanyLookUpNav() throws Exception {
90 testTravelCompanyLookUp();
91 passed();
92 }
93 }