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