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 DemoTravelDestinationLookUpAft extends ViewDemoAftBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&dataObjectClassName=edu.sampleu.travel.dataobject.TravelDestination";
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 DESTINATION_ID = "lookupCriteria[travelDestinationId]";
45
46
47
48
49 public static final String DESTINATION_NAME = "lookupCriteria[travelDestinationName]";
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 Destination Lookup");
60 }
61
62 protected void testTravelDestinationLookUp() throws Exception {
63 waitAndTypeByName(DESTINATION_ID,"1");
64 waitAndTypeByName(DESTINATION_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","Colorado","United States","Colorado","true"};
72 Thread.sleep(1000);
73 assertTextPresent(activeResults);
74 }
75
76 @Test
77 public void testTravelDestinationLookUpBookmark() throws Exception {
78 testTravelDestinationLookUp();
79 passed();
80 }
81
82 @Test
83 public void testTravelDestinationLookUpNav() throws Exception {
84 testTravelDestinationLookUp();
85 passed();
86 }
87 }