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.testtools.selenium.WebDriverLegacyITBase;
19  import org.junit.Test;
20  
21  
22  
23  
24  public class DemoTravelMileageLookUpAft extends WebDriverLegacyITBase {
25  
26      
27  
28  
29      public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&dataObjectClassName=edu.sampleu.travel.dataobject.TravelMileageRate";
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      @Override
42      public String getBookmarkUrl() {
43          return BOOKMARK_URL;
44      }
45  
46      @Override
47      protected void navigate() throws Exception {
48          waitAndClickById("Demo-DemoLink", "");
49          waitAndClickByLinkText("Travel Mileage Lookup");
50      }
51  
52      protected void testTravelMileageLookUp() throws Exception {
53      	waitAndTypeByName("lookupCriteria[mileageRateId]","1");
54      	waitAndTypeByName("lookupCriteria[mileageRateCd]","a*");
55      	waitAndTypeByName("lookupCriteria[mileageRateName]","a*");
56      	waitAndClickButtonByText(SEARCH);
57      	waitForTextPresent("No values match this search.");
58      	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.");
59      	waitAndClickButtonByText(CLEAR_VALUES);
60      	waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='Y']");
61      	waitAndClickButtonByText(SEARCH);
62      	String activeResults [] ={"10000","DO","Domestic","0.305","true"};
63      	Thread.sleep(1000); 
64      	assertTextPresent(activeResults);
65      	waitAndClickButtonByText(CLEAR_VALUES);
66      	waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
67      	waitAndClickButtonByText(SEARCH);
68      	waitForTextPresent("No values match this search.");
69      	
70  		
71  		
72  		
73      }
74  
75      @Test
76      public void testTravelMileageLookUpBookmark() throws Exception {
77          testTravelMileageLookUp();
78          passed();
79      }
80  
81      @Test
82      public void testTravelMileageLookUpNav() throws Exception {
83          testTravelMileageLookUp();
84          passed();
85      }
86  }