use of org.openqa.selenium.support.ui.WebDriverWait in project geode by apache.
the class PulseTestUtils method verifyElementPresentByXpath.
public static void verifyElementPresentByXpath(String xpath) {
WebDriverWait wait = new WebDriverWait(getDriver(), maxWaitTime, 500);
wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(xpath)));
}
use of org.openqa.selenium.support.ui.WebDriverWait in project rstudio by rstudio.
the class ConsoleTestUtils method waitForConsoleContainsText.
public static void waitForConsoleContainsText(WebDriver driver, final String text) {
final WebElement output = driver.findElement(By.id(ElementIds.getElementId(ElementIds.CONSOLE_OUTPUT)));
(new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
String outputText = output.getText();
return outputText.contains(text);
}
});
}
use of org.openqa.selenium.support.ui.WebDriverWait in project rstudio by rstudio.
the class DialogTestUtils method respondToModalDialog.
public static void respondToModalDialog(WebDriver driver, String response) {
WebElement dialog = waitForModalToAppear(driver);
// Find the button requested and invoke it
List<WebElement> buttons = dialog.findElements(By.className("gwt-Button-DialogAction"));
for (WebElement button : buttons) {
if (button.getText().equals(response)) {
button.click();
break;
}
}
(new WebDriverWait(driver, 5)).until(ExpectedConditions.stalenessOf(dialog));
}
use of org.openqa.selenium.support.ui.WebDriverWait in project rstudio by rstudio.
the class RConsoleInteraction method testPlotGeneration.
@Test
public void testPlotGeneration() {
ConsoleTestUtils.resumeConsoleInteraction(driver_);
Actions plotCars = new Actions(driver_);
plotCars.sendKeys(Keys.ESCAPE + "plot(cars)" + Keys.ENTER);
plotCars.perform();
// Wait for the Plot window to activate
final WebElement plotWindow = (new WebDriverWait(driver_, 5)).until(ExpectedConditions.presenceOfElementLocated(By.id(ElementIds.getElementId(ElementIds.PLOT_IMAGE_FRAME))));
// Wait for a plot to appear in the window
Assert.assertEquals(plotWindow.getTagName(), "iframe");
driver_.switchTo().frame(plotWindow);
(new WebDriverWait(driver_, 5)).until(ExpectedConditions.presenceOfElementLocated(By.tagName("img")));
// Switch back to document context
driver_.switchTo().defaultContent();
}
use of org.openqa.selenium.support.ui.WebDriverWait in project rstudio by rstudio.
the class RConsoleInteraction method testInvokeHelp.
@Test
public void testInvokeHelp() {
ConsoleTestUtils.resumeConsoleInteraction(driver_);
Actions help = new Actions(driver_);
help.sendKeys(Keys.ESCAPE + "?lapply" + Keys.ENTER);
help.perform();
// Wait for the Help window to activate
final WebElement helpWindow = (new WebDriverWait(driver_, 5)).until(ExpectedConditions.presenceOfElementLocated(By.id(ElementIds.getElementId(ElementIds.HELP_FRAME))));
// Wait for help to appear in the window
Assert.assertEquals(helpWindow.getTagName(), "iframe");
driver_.switchTo().frame(helpWindow);
(new WebDriverWait(driver_, 5)).until(ExpectedConditions.textToBePresentInElement(By.tagName("body"), "lapply"));
// Switch back to document context
driver_.switchTo().defaultContent();
}
Aggregations