use of com.qaprosoft.carina.core.gui.AbstractPage in project carina by qaprosoft.
the class DriverHelper method isPageOpened.
public boolean isPageOpened(final AbstractPage page, long timeout) {
boolean result;
final WebDriver drv = getDriver();
Wait<WebDriver> wait = new WebDriverWait(drv, timeout, RETRY_TIME);
try {
wait.until((Function<WebDriver, Object>) dr -> LogicUtils.isURLEqual(page.getPageURL(), drv.getCurrentUrl()));
result = true;
} catch (Exception e) {
result = false;
}
if (!result) {
LOGGER.warn(String.format("Actual URL differs from expected one. Expected '%s' but found '%s'", page.getPageURL(), drv.getCurrentUrl()));
}
return result;
}
Aggregations