Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.WebDriverWait


      public Boolean apply(WebDriver driver) {
        WebElement notification = driver.findElements(By.id("notification")).get(0);
        return notification.getText().equals("Configuration Deleted");
      }
    };
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(isDeleted);
  }
View Full Code Here


                        .xpath(
                        "//li[contains(text(),'Crawl Execution Queue')]/following-sibling::li//span[contains(i,'running')]"));
        return running != null;
      }
    };
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(isRunning);

    ExpectedCondition<Boolean> isComplete = new ExpectedCondition<Boolean>() {
      public Boolean apply(WebDriver driver) {
        WebElement success =
                driver.findElement(By
                        .xpath(
                        "//li[contains(text(),'Crawl Execution Queue')]/following-sibling::li//span[contains(i,'success')]"));
        return success != null;
      }
    };
    wait = new WebDriverWait(driver, 60);
    wait.until(isComplete);

    List<WebElement> crawlHistoryLink = driver.findElements(By.linkText("Crawl History"));
    followLink(crawlHistoryLink.get(0));

    WebElement crawlLink = driver.findElement(By.xpath(
View Full Code Here

    List<WebElement> uploadLink = driver.findElements(By.linkText("Upload"));
    followLink(uploadLink.get(0));

    WebElement uploaded =
            (new WebDriverWait(driver, 10))
                    .until(ExpectedConditions.presenceOfElementLocated(By
                            .xpath(
                            "//legend[contains(text(),'Available Plugins')]/following-sibling::table//td[contains(text(),'"
                                    + LOCAL_PLUGIN_NAME + "')]")));
    assertNotNull(uploaded);
View Full Code Here

    List<WebElement> downloadLink = driver.findElements(By.linkText("Add"));
    followLink(downloadLink.get(0));

    WebElement uploaded =
            (new WebDriverWait(driver, 10))
                    .until(ExpectedConditions.presenceOfElementLocated(By
                            .xpath(
                            "//legend[contains(text(),'Available Plugins')]/following-sibling::table//td[contains(text(),'"
                                    + REMOTE_PLUGIN_NAME + "')]")));
    assertNotNull(uploaded);
View Full Code Here

        public Boolean apply(WebDriver driver) {
          WebElement notification = driver.findElements(By.id("notification")).get(0);
          return notification.getText().equals("Plugin Deleted");
        }
      };
      WebDriverWait wait = new WebDriverWait(driver, 10);
      wait.until(isDeleted);
      if (!isElementPresent(driver, By.linkText("Delete"))) {
        break;
      }
      deleteLinks = driver.findElements(By.linkText("Delete"));
    }
View Full Code Here

    public void testButtonLabelRequired() throws Exception {
        final String errorMsg = "COMPONENT markup://uitest:button_LabelRequiredTest is missing required attribute 'label'";
        openNoAura("/uitest/button_LabelRequiredTest.cmp");
        auraUITestingUtil.waitForDocumentReady();
        WebDriverWait wait = new WebDriverWait(getDriver(), timeoutInSecs);
        wait.withMessage("Required label error not displayed");
        wait.until(new ExpectedCondition<Boolean>() {
            @Override
            public Boolean apply(WebDriver d) {
                return auraUITestingUtil.getQuickFixMessage().contains(errorMsg);
            }
        });
View Full Code Here

    public void testModelSerializationException() throws Exception {
        openNoAura("/auratest/testModelThatThrows.cmp");
        auraUITestingUtil.waitForDocumentReady();
        List<WebElement> errorBoxes = getDriver().findElements(By.cssSelector(".auraForcedErrorBox"));
        assertEquals("Renderer element found", 0, errorBoxes.size());
        WebDriverWait wait = new WebDriverWait(getDriver(), timeoutInSecs);
        errorBoxes = wait.until(new ExpectedCondition<List<WebElement>>() {
            @Override
            public List<WebElement> apply(WebDriver d) {
                List<WebElement> errors = getDriver().findElements(By.cssSelector(".auraErrorBox"));
                if (errors.size() > 0 && errors.get(0).isDisplayed()) {
                    return errors;
View Full Code Here

                    return componentRendered;
                }
                return null;
            }
        };
        By locatorFound = new WebDriverWait(currentDriver, 60).withMessage("Error loading " + descriptor).until(
                condition);

        if (locatorFound == auraErrorMessage) {
            fail("Error loading " + descriptor.getName() + ": "
                    + currentDriver.findElement(auraErrorMessage).getText());
View Full Code Here

            return super.getAllowedVariability(metricName);
        }
    };

    protected final <V> V waitUntil(final Function<? super WebDriver, V> function) {
        return new WebDriverWait(currentDriver, timeoutInSecs)
                .until(new Function<WebDriver, V>() {
                    @Override
                    public V apply(WebDriver d) {
                        return function.apply(d);
                    }
View Full Code Here

    /**
     * Wait for a specified amount of time.
     */
    public void waitFor(long timeoutInSeconds) {
        WebDriverWait wait = new WebDriverWait(getDriver(), timeoutInSeconds);
        try {
            wait.until(new ExpectedCondition<Boolean>() {
                @Override
                public Boolean apply(WebDriver d) {
                    return false;
                }
            });
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.ui.WebDriverWait

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.