001 package edu.samplu.krad.labs;
002
003 import edu.samplu.common.SmokeTestBase;
004 import org.junit.Test;
005
006 /**
007 * @author Kuali Rice Team (rice.collab@kuali.org)
008 */
009
010 public class DemoPerformanceMediumSmokeTest extends SmokeTestBase {
011
012 /**
013 * /kr-krad/labs?viewId=Lab-PerformanceMedium
014 */
015 public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-PerformanceMedium";
016
017 /**
018 * /kr-krad/labs?viewId=Lab-PerformanceMedium&pageId=Lab-Performance-Page1#Lab-Performance-Page2
019 */
020 public static final String BOOKMARK_URL_2 = "/kr-krad/labs?viewId=Lab-PerformanceMedium&pageId=Lab-Performance-Page1#Lab-Performance-Page2&methodToCall=start";
021
022 @Override
023 protected String getBookmarkUrl() {
024 return BOOKMARK_URL;
025 }
026
027 @Override
028 protected void navigate() throws Exception {
029 waitAndClickByLinkText("Performance Medium");
030 }
031
032 @Test
033 public void testPerformanceMediumBookmark() throws Exception {
034 testPerformanceMedium();
035 navigateToSecondPage(); // how to bookmark the second page?
036 // driver.navigate().to(ITUtil.getBaseUrlString() + BOOKMARK_URL_2);
037 passed();
038 }
039
040 @Test
041 public void testPerformanceMediumNav() throws Exception {
042 testPerformanceMedium();
043 navigateToSecondPage();
044 passed();
045 }
046
047 private void navigateToSecondPage() throws InterruptedException {
048 waitAndClickByLinkText("Page 2");
049 waitForBottomButton();
050 }
051
052 private void waitForBottomButton() throws InterruptedException {
053 waitForElementsPresentByXpath("//button[contains(text(), 'Refresh - Non-Ajax')]");
054 }
055
056 protected void testPerformanceMedium()throws Exception {
057 waitForBottomButton();
058 }
059 }