1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.admin.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 AdminTmplMthdSTNavBase extends NavTemplateMethodSTBase {
26
27 public static final String CREATE_NEW_LOCATOR = "//img[contains(@alt,'create new')]";
28
29
30 public static final String ADMIN_LOCATOR = "Administration";
31 public static final String LABEL_KUALI_KUALI_SYSTEMS = "KUALI - Kuali Systems";
32 public static final String LABEL_KUALI_DEFAULT = "KUALI : Default";
33 public static final String SPAN_CLASS_PAGEBANNER = "//span[@class='pagebanner']";
34
35 @Override
36 protected String getCreateNewLinkLocator() {
37 return CREATE_NEW_LOCATOR;
38 }
39
40 @Override
41 protected String getMenuLinkLocator() {
42 return ADMIN_LOCATOR;
43 }
44
45
46
47
48 public void testCreateNewCancelNav() throws Exception {
49 gotoCreateNew();
50 testCancelConfirmation();
51 }
52
53
54
55
56 public void testEditCancel() throws Exception {
57 gotoMenuLinkLocator();
58 testSearchEditCancel();
59 }
60
61 public void testSearchEditBack(Failable failable) throws Exception {
62 waitAndClickSearch2();
63 String pageBannerText = getTextByXpath(SPAN_CLASS_PAGEBANNER);
64 waitAndClickByLinkText("edit");
65 waitFor(By.name(BLANKET_APPROVE_NAME));
66 back();
67 checkForIncidentReport();
68 assertTextPresent("Going back from Edit Search results not available", pageBannerText);
69 }
70
71 public void testSearchSearchBack(Failable failable, String fieldName, String searchText) throws Exception {
72 waitAndClickSearch2();
73 String pageBannerText = getTextByXpath(SPAN_CLASS_PAGEBANNER);
74 waitAndTypeByName(fieldName, searchText);
75 waitAndClickSearch2();
76 back();
77 assertTextPresent("Going back from Search to Search results not available", pageBannerText);
78 }
79 }