1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package edu.samplu.krad.demo.lookupviews.lookup;
17  
18  import edu.samplu.common.Failable;
19  import edu.samplu.common.SmokeTestBase;
20  
21  
22  
23  
24  public class DemoLookUpAbstractSmokeTestBase extends SmokeTestBase {
25  
26      
27  
28  
29      public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleView&hideReturnLink=true";
30  
31      
32  
33  
34      private static final String LOOKUP_CRITERIA_NUMBER_NAME="lookupCriteria[number]";
35      
36      
37  
38  
39      private static final String SEARCH="Search";
40      
41      
42  
43  
44      private static final String CLEAR_VALUES="Clear Values";
45      
46      @Override
47      public String getBookmarkUrl() {
48          return BOOKMARK_URL;
49      }
50  
51      @Override
52      protected void navigate() throws Exception {
53          waitAndClickById("Demo-DemoLink", "");
54          waitAndClickByLinkText("Lookup");
55      }
56  
57      protected void testLookUp() throws InterruptedException {
58          waitAndTypeByName(LOOKUP_CRITERIA_NUMBER_NAME,"a1");
59          waitAndClickButtonByText(SEARCH);
60          Thread.sleep(3000);
61          assertElementPresentByXpath("//a[contains(text(), 'a1')]");
62          waitAndClickButtonByText(CLEAR_VALUES);
63          waitAndClickButtonByText(SEARCH);
64          Thread.sleep(3000);
65          assertElementPresentByXpath("//a[contains(text(), 'a1')]");
66          assertElementPresentByXpath("//a[contains(text(), 'a2')]");
67      }
68  
69      public void testLookUpBookmark(Failable failable) throws Exception {
70          testLookUp();
71          passed();
72      }
73  
74      public void testLookUpNav(Failable failable) throws Exception {
75          testLookUp();
76          passed();
77      }
78  }