/**
  * Navigates user to Eat Smart Page.
  *
  * @return EatSmartPage
  */
 public EatSmartPage clickEatSmartLink() {
   selenium.goBack();
   selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
   selenium.click(Dashboard.EAT_SMART_MENU_LINK);
   selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
   return new EatSmartPage(selenium);
 }
示例#2
0
  /** This method stops LoggingSelenium session and sets its instance to null. */
  public void stopSeleniumInstance() {
    // Comment these lines just for UrgentWowyTest
    /*logger.info("Taking screen shot before closing selenium instance");
    if (lastTestMethodResult == true) captureScreenShot(selenium, currentScreenShotPath);*/

    try {

      logger.info("Clicking on 'Sign Out' if not signed out");
      // if(selenium.isElementPresent("css=a:contains(Sign Out)")) {
      if (selenium.isTextPresent("Sign Out")) {
        selenium.click("css=a:contains(Sign Out)");
        selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
      }
    } catch (Exception e) {
      logger.info(e.getMessage());
    }

    logger.info("Setting sign  in count to 0");
    signInCount = 0;

    try {
      logger.info("Stopping selenium session");
      selenium.stop();
      logger.info("Setting selenium Instance as null");
      selenium = null;

      if (null != loggingWriter) {
        loggingWriter.close();
        loggingWriter = null;
      }
    } catch (Exception e) {
      // do nothing
    }
  }
 /** Clicks on Sign out link to sign out of the website. */
 public void clickSignOut() {
   selenium.click(Home.SIGNOUT_LINK);
   selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
   selenium.waitForElementPresent(Home.SIGN_IN_LINK);
 }
 /**
  * Clicks on 'Learn More' link for 'P90X Peak Performance Protein Bars'. Navigates user to
  * Shopping Cart Page.
  *
  * @return ShoppingCartPage
  */
 public ShoppingCartPage clickP90XPeakPerformanceProteinBarsLearnMoreLink() {
   selenium.click(P90X_PEAK_PERFORMANCE_PROTEIN_BARS_LEARN_MORE);
   selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
   return new ShoppingCartPage(selenium);
 }
 /**
  * Clicks on Slimming Formula Learn More Link. Navigates user to Shopping Cart Page.
  *
  * @return
  */
 public ShoppingCartPage clickSlimmingFormulaLearnMoreLink() {
   selenium.click(SLIMMING_FORMULA_LEARN_MORE);
   selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
   return new ShoppingCartPage(selenium);
 }
 /**
  * Clicks on 'Learn More' link for Shakeology. Navigates user to Shakeology Page.
  *
  * @return ShakeologyPage
  */
 public ShakeologyPage clickShakeologyLearnMoreLink() {
   selenium.click(SHAKEOLOGY_LEARN_MORE);
   selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
   return new ShakeologyPage(selenium);
 }
 /**
  * Clicks on 'Contest FAQ' link in the left hand menu. Navigates user to Contest FAQ Page.
  *
  * @return ContestFAQPage
  */
 public ContestFAQPage goToContestFAQPage() {
   selenium.click(Contests.LEFT_MENU_CONTEST_FAQ_LINK);
   selenium.waitForPageToLoad(TestConsts.PAGE_LOAD_TIMEOUT);
   return new ContestFAQPage(selenium);
 }