View Javadoc

1   package edu.samplu.common;
2   
3   import org.openqa.selenium.By;
4   
5   /**
6    * @deprecated use WebDriverITBase
7    * @author Kuali Rice Team (rice.collab@kuali.org)
8    */
9   
10  public abstract class MenuLegacyITBase extends WebDriverLegacyITBase {
11      @Override
12      public String getTestUrl() {
13          return ITUtil.PORTAL;
14      }
15  
16      /**
17       * TODO when the UpgradedSelenium tests have been converted over, rename this to getMenuLinkText
18       * Override to return menu click selector (e.g. "Main Menu")
19       * @return selenium locator to click on
20       */
21      protected abstract String getMenuLinkLocator();
22  
23      /**
24       * TODO when the UpgradedSelenium tests have been converted over, rename this to getLinkText
25       * Override to return main menu click selector (e.g. "Agenda lookup")
26       * @return selenium locator to click on
27       */
28      protected abstract String getLinkLocator();
29  
30  
31      /**
32       * Override to return main menu click selector (e.g. "//img[@alt='create new']")
33       * @return selenium locator to click on
34       */
35      protected abstract String getCreateNewLinkLocator();
36  
37      /**
38       * go to the getMenuLinkLocator() Menu and click the getLinkLocator()
39       */
40      protected void gotoMenuLinkLocator(String message) throws Exception {
41          waitForTitleToEqualKualiPortalIndex();
42          waitAndClickByLinkText(getMenuLinkLocator(), message);
43          waitForTitleToEqualKualiPortalIndex();
44          waitAndClickByLinkText(getLinkLocator(), message);
45          waitForTitleToEqualKualiPortalIndex(message);
46          selectFrame("iframeportlet");
47          checkForIncidentReport(getLinkLocator(), message);
48      }
49  
50      protected void gotoMenuLinkLocator() throws Exception {
51          gotoMenuLinkLocator("");
52      }
53      /**
54       * go to having clicked create new of the getLinkLocator()
55       */
56      protected void gotoCreateNew() throws Exception {
57          gotoMenuLinkLocator();
58          waitAndClick(By.xpath(getCreateNewLinkLocator()));
59          //        selectFrame("relative=up");
60          checkForIncidentReport(getCreateNewLinkLocator());
61      }
62  }