1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.mainmenu.test;
17
18 import edu.samplu.common.Failable;
19 import edu.samplu.common.NavTemplateMethodSTBase;
20 import org.openqa.selenium.By;
21
22
23
24
25 public abstract class MainTmplMthdSTNavBase extends NavTemplateMethodSTBase {
26
27 public static final String DATA_TABLES_INFO = "dataTables_info";
28
29 @Override
30 protected String getCreateNewLinkLocator() {
31 return "Create New";
32 }
33
34 @Override
35 protected String getMenuLinkLocator() {
36 return "Main Menu";
37 }
38
39 protected void testSearchEditBack(Failable failable) throws Exception {
40 waitAndClickSearch3();
41 waitForElementPresentByClassName(DATA_TABLES_INFO);
42 String pageBannerText = getText(By.className(DATA_TABLES_INFO));
43 waitAndClickEdit();
44 waitForElementPresentByClassName("uif-headerText-span");
45 back();
46 waitForElementPresentByClassName(DATA_TABLES_INFO);
47 if (!pageBannerText.equals(getText(By.className(DATA_TABLES_INFO)))) {
48 failable.fail("Going back from Search to Edit results not available");
49 }
50 }
51
52 protected void testSearchSearchBack(Failable failable, String fieldName, String searchText) throws Exception {
53 waitAndClickSearch3();
54 waitForElementPresentByClassName(DATA_TABLES_INFO);
55 String pageBannerText = getText(By.className(DATA_TABLES_INFO));
56 waitAndTypeByName(fieldName, searchText);
57 waitAndClickSearch3();
58 waitForElementPresentByClassName(DATA_TABLES_INFO, "Problem with second search");
59 back();
60 waitForElementsPresentByClassName(DATA_TABLES_INFO, "Going back from Search to Search results not available");
61 assertTextPresent("Going back from Search to Search results not available", pageBannerText);
62 }
63 }