Пример #1
0
Файл: Tab.java Проект: 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;
 }
Пример #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();
  }
Пример #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();
                  }
                }
              });
    }
  }
Пример #4
0
 public void successfullyPaid() {
   successMessageElement.assertReady();
 }
Пример #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);
 }
Пример #6
0
Файл: Tab.java Проект: 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();
 }