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