Example usage for org.openqa.selenium.support.ui ExpectedConditions textToBePresentInElement

List of usage examples for org.openqa.selenium.support.ui ExpectedConditions textToBePresentInElement

Introduction

In this page you can find the example usage for org.openqa.selenium.support.ui ExpectedConditions textToBePresentInElement.

Prototype

public static ExpectedCondition<Boolean> textToBePresentInElement(final WebElement element, final String text) 

Source Link

Document

An expectation for checking if the given text is present in the specified element.

Usage

From source file:org.apache.deltaspike.test.jsf.impl.scope.window.WindowScopedContextTest.java

License:Apache License

@Test
@RunAsClient//from w  w w  .j  av a2 s .  co m
public void testWindowId() throws Exception {
    System.out.println("contextpath= " + contextPath);

    //X comment this in if you like to debug the server
    //X I've already reported ARQGRA-213 for it
    //X Thread.sleep(600000L);

    driver.get(new URL(contextPath, "page.xhtml").toString());

    WebElement inputField = driver.findElement(By.id("test:valueInput"));
    inputField.sendKeys("23");

    WebElement button = driver.findElement(By.id("test:saveButton"));
    button.click();

    Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("valueOutput"), "23").apply(driver));

}

From source file:org.cc.demo.test.Selenium2.java

License:Apache License

/**
 * Elementtext, timeout??./*from  ww  w. ja  va 2  s  .c o m*/
 */
public void waitForTextPresent(By by, String text, int timeout) {
    (new WebDriverWait(driver, timeout)).until(ExpectedConditions.textToBePresentInElement(by, text));
}

From source file:org.eclipse.che.selenium.pageobject.DialogAbout.java

License:Open Source License

/**
 * Verifies text elements in the About Dialog
 *
 * @param text is a certain text of element
 *///from   www.  ja v a 2s .c o  m
public void waitVerifyTextElements(String text) {
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.textToBePresentInElement(aboutDialog, text));
}

From source file:org.eclipse.che.selenium.pageobject.FindAction.java

License:Open Source License

/**
 * wait text in the 'Find Action' form/*from  w  w w  .j  av  a2s.c om*/
 *
 * @param expectedText expected text
 */
public void waitTextInFormFindAction(String expectedText) {
    waitWithRedrawTimeout.until(ExpectedConditions.textToBePresentInElement(resultTextBox, expectedText));
}

From source file:org.eclipse.che.selenium.pageobject.git.GitBranches.java

License:Open Source License

/**
 * wait for the search filter label to be with given text.
 *
 * @param text text to check//from  ww w.j  a v a2 s. c  o m
 */
public void waitSearchFilerWithText(String text) {
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.textToBePresentInElement(searchFilterLabel, text));
}

From source file:org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole.java

License:Open Source License

/**
 * wait single method in the result tree marked as failed (red color)
 *
 * @param nameOfFailedMethods name of that should fail
 *//*from   ww w  . jav a  2s . c om*/
public void waitMethodMarkedAsFailed(String nameOfFailedMethods) {
    new WebDriverWait(seleniumWebDriver, MINIMUM_SEC)
            .until(ExpectedConditions.textToBePresentInElement(failedMethod, nameOfFailedMethods));
}

From source file:org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole.java

License:Open Source License

/**
 * wait single method in the result tree marked as failed (red color)
 *
 * @param nameOfFailedMethods name of that should fail
 */// ww  w . j a  v a2 s . c om
public void waitMethodMarkedAsIgnored(String nameOfFailedMethods) {
    new WebDriverWait(seleniumWebDriver, MINIMUM_SEC)
            .until(ExpectedConditions.textToBePresentInElement(ignoredMethod, nameOfFailedMethods));
}

From source file:org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole.java

License:Open Source License

/**
 * wait single method in the result tree marked as passed (green color)
 *
 * @param nameOfFailedMethods name of expected method
 *//*  w  ww. ja va  2  s  . com*/
public void waitMethodMarkedAsPassed(String nameOfFailedMethods) {
    new WebDriverWait(seleniumWebDriver, MINIMUM_SEC)
            .until(ExpectedConditions.textToBePresentInElement(passedMethod, nameOfFailedMethods));
}

From source file:org.eclipse.che.selenium.pageobject.WarningDialog.java

License:Open Source License

/** wait appearance a warning dialog */
public void waitWaitWarnDialogWindowWithSpecifiedTextMess(String mess) {
    new WebDriverWait(seleniumWebDriver, LOADER_TIMEOUT_SEC)
            .until(ExpectedConditions.textToBePresentInElement(warningDialog, mess));
}

From source file:org.exoplatform.addons.portlets.springmvc.ContactsPortletTest.java

License:Open Source License

@Test
@RunAsClient// w  ww.j  av  a 2 s .  co  m
public void testContactsList() throws URISyntaxException, InterruptedException {
    // go to the contacts list page (home page)
    browser.get(portalURL.toString());

    // check that the list exists and that the 2 initial contacts have been well created
    WebElement contactsList = browser.findElement(By.id("contactsList"));
    Assert.assertNotNull("Check that contacts list exists", contactsList);
    Assert.assertTrue("Check that Mary is listed",
            ExpectedConditions.textToBePresentInElement(contactsList, "Mary").apply(browser));
    Assert.assertTrue("Check that John is listed",
            ExpectedConditions.textToBePresentInElement(contactsList, "John").apply(browser));
}