1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package edu.samplu.krad.labs.lookups;
17  
18  import org.junit.Test;
19  
20  
21  
22  
23  
24  public class DemoLabsLookupResultsLimitSmokeTest extends DemoLabsLookupBase {
25  
26      
27  
28  
29      public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LabsLookup-ResultsLimitView&hideReturnLink=true";
30      
31      @Override
32      protected String getBookmarkUrl() {
33          return BOOKMARK_URL;
34      }
35  
36      @Override
37      protected void navigate() throws Exception {
38          navigateToLookup("Lookup Results Limit");
39      }
40  
41      @Test
42      public void testLabsLookupResultsLimitBookmark() throws Exception {
43          testLabsLookupResultsLimit();
44          passed();
45      }
46  
47      @Test
48      public void testLabsLookupResultsLimitNav() throws Exception {
49          testLabsLookupResultsLimit();
50          passed();
51      }
52      
53      protected void testLabsLookupResultsLimit()throws Exception {
54          waitAndTypeByName("lookupCriteria[number]","a*");
55          waitAndClickButtonByText("Search");
56          Thread.sleep(3000);
57          assertTextPresent("TRAVEL ACCOUNT 14");
58          assertTextPresent("a14");
59          assertElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr[2]");
60          if(isElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr[3]")) {
61              fail("More than 2 results available");
62          }
63          waitAndClickButtonByText("Clear Values");
64          waitAndClickButtonByText("Search");
65          Thread.sleep(3000);
66          assertTextPresent("Travel Account 1");
67          assertTextPresent("a1");
68          assertElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr[2]");
69          if(isElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr[3]")) {
70              fail("More than 2 results available");
71          }
72      }
73  }