com.gfk.senbot.framework.cucumber.stepdefinitions.ExpectedWebElementCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SenBotRunner Show documentation
Show all versions of SenBotRunner Show documentation
The SenBot runner which will actually run all your acceptance tests and report the outcome
package com.gfk.senbot.framework.cucumber.stepdefinitions;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.gfk.senbot.framework.context.SenBotContext;
public class ExpectedWebElementCondition implements ExpectedGlobalCondition {
private static final Logger log = LoggerFactory.getLogger(ExpectedWebElementCondition.class);
private final By locator;
/**
* @param locator
*/
public ExpectedWebElementCondition(By locator) {
this.locator = locator;
}
@Override
public void checkExpected(WebDriver webDriver) {
log.debug("Check for invisibility of " + locator);
ExpectedCondition invisibilityOfElementLocated = ExpectedConditions.invisibilityOfElementLocated(locator);
new WebDriverWait(webDriver, SenBotContext.getSenBotContext().getSeleniumManager().getTimeout()).until(invisibilityOfElementLocated);
log.debug("Invisibility of " + locator + " detected");
}
public By getLocator() {
return locator;
}
@Override
public String toString() {
return "Wait for invisibilty of:" + locator;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy