Ejemplo n.º 1
0
Archivo: Tab.java Proyecto: sdl/Testy
 /**
  * After the tab is set to active
  *
  * @return true or false
  */
 @Override
 public boolean setActive() {
   boolean activated = isActive();
   if (!activated) {
     WebLocator locator1 =
         new WebLocator(getPathBuilder().getContainer()).withElxPath(getTitlePath(false));
     WebLocator titleElement = locator1.withInfoMessage(getPathBuilder().getText() + " Tab");
     activated = titleElement.click();
   }
   if (activated) {
     LOGGER.info("setActive : " + toString());
   }
   return activated;
 }
Ejemplo n.º 2
0
  public void selectAll() {
    invoiceMenuItem.mouseOver();
    invoicesListItem.assertClick();

    WebLocator waiting = new WebLocator().setText("Se încarcă...");
    ConditionManager conditionManager =
        new ConditionManager().add(new ElementRemovedSuccessCondition(waiting));
    Condition condition = conditionManager.execute();

    closePromo.click();

    if (seeInvoices.isElementPresent()) {
      seeInvoices.assertClick();
    }

    closePromo.click();

    selectAllButton.assertClick();
  }
Ejemplo n.º 3
0
  public static void init(WebDriver driver) {
    if (driver != null) {
      LOGGER.info("===============================================================");
      LOGGER.info("|          Open Selenium Web Driver ");
      LOGGER.info("===============================================================\n");
      WebDriverConfig.driver = driver;
      WebLocator.setDriverExecutor(driver);
      if (driver instanceof InternetExplorerDriver) {
        isIE = true;
      } else if (driver instanceof ChromeDriver) {
        isChrome = true;
      } else if (driver instanceof FirefoxDriver) {
        isFireFox = true;
      } else if (driver instanceof SafariDriver) {
        isSafari = true;
      } else if (driver instanceof OperaDesktopDriver) {
        isOpera = true;
      }

      driver.manage().window().maximize();
      driver
          .manage()
          .timeouts()
          .implicitlyWait(WebLocatorConfig.getInt("driver.implicitlyWait"), TimeUnit.MILLISECONDS);

      Runtime.getRuntime()
          .addShutdownHook(
              new Thread() {
                public void run() {
                  if (WebLocatorConfig.getBoolean("driver.autoClose")) {
                    initSeleniumEnd();
                  }
                }
              });
    }
  }
Ejemplo n.º 4
0
 public void successfullyPaid() {
   successMessageElement.assertReady();
 }
Ejemplo n.º 5
0
 public void switchToPopup() {
   WebLocator popup = new WebLocator().setClasses("popup");
   WebLocator iframe = new WebLocator(popup).setTag("iframe");
   iframe.assertReady();
   WebDriverConfig.getDriver().switchTo().frame(iframe.currentElement);
 }
Ejemplo n.º 6
0
Archivo: Tab.java Proyecto: sdl/Testy
 private String getTitlePath(boolean active) {
   WebLink link = new WebLink().withText(getPathBuilder().getText(), SearchType.EQUALS);
   String isActive = active ? "@class='active'" : "not(@class='active')";
   WebLocator el = new WebLocator().withTag("ul").withClasses(getPathBuilder().getBaseCls());
   return el.getXPath() + "//li[" + isActive + "]" + link.getXPath();
 }