use of com.github.timurstrekalov.saga.core.webdriver.SafeJavascriptWait in project saga by timurstrekalov.
the class GenericInstrumentingBrowser method get.
@Override
public void get(final String url) {
driver.get(url);
final JavascriptExecutor js = (JavascriptExecutor) driver;
WebDriverUtils.waitForWindowJavaScriptVariableToBePresent(js, SAGA_NAMESPACE);
new SafeJavascriptWait(js).withTimeout(config.getBackgroundJavaScriptTimeout(), TimeUnit.MILLISECONDS).until(new Predicate<JavascriptExecutor>() {
@Override
public boolean apply(final JavascriptExecutor input) {
logger.debug("Waiting for test runner to finish");
return Boolean.TRUE.equals(input.executeScript("return " + SAGA_NAMESPACE + ".completed()"));
}
});
}
Aggregations