001 package edu.samplu.common;
002
003 /**
004 * @deprecated Use WebDriverITBase for new tests.
005 * @author Kuali Rice Team (rice.collab@kuali.org)
006 */
007 public abstract class MenuITBase extends UpgradedSeleniumITBase {
008 @Override
009 public String getTestUrl() {
010 return ITUtil.PORTAL;
011 }
012
013 /**
014 * Override to return menu click selector (e.g. "link=Main Menu")
015 * @return selenium locator to click on
016 */
017 protected abstract String getMenuLinkLocator();
018
019 /**
020 * Override to return main menu click selector (e.g. "link=Agenda lookup")
021 * @return selenium locator to click on
022 */
023 protected abstract String getLinkLocator();
024
025
026 /**
027 * Override to return main menu click selector (e.g. "//img[@alt='create new']")
028 * @return selenium locator to click on
029 */
030 protected abstract String getCreateNewLinkLocator();
031
032 /**
033 * go to the getMenuLinkLocator() Menu and click the getLinkLocator()
034 */
035 protected void gotoMenuLinkLocator(String message) throws Exception {
036 waitForTitleToEqualKualiPortalIndex();
037 waitAndClick(getMenuLinkLocator(), message);
038 waitForTitleToEqualKualiPortalIndex();
039 waitAndClick(getLinkLocator(), message);
040 waitForTitleToEqualKualiPortalIndex(message);
041 selectFrame("iframeportlet");
042
043 checkForIncidentReport(getLinkLocator(), message);
044 }
045
046 protected void gotoMenuLinkLocator() throws Exception {
047 gotoMenuLinkLocator("");
048 }
049 /**
050 * go to having clicked create new of the getLinkLocator()
051 */
052 protected void gotoCreateNew() throws Exception {
053 gotoMenuLinkLocator();
054 waitAndClick(getCreateNewLinkLocator(), "");
055 // selectFrame("relative=up");
056 checkForIncidentReport(getCreateNewLinkLocator());
057 }
058 }