this.target = target;
}
public WaitingWrapper waitUntilTooltipIsNotVisible() {
return getIdOfTooltip() == null
? new WaitingWrapperImpl() {
@Override
protected void performWait(FluentWait<WebDriver, Void> wait) {
wait.until(new Predicate<WebDriver>() {
@Override
public boolean apply(WebDriver input) {
if (getTooltipsBefore() == 0) {
return driver.findElements(getTooltipsSelector()).isEmpty();
} else {
return driver.findElements(getTooltipsSelector()).size() < getTooltipsBefore();
}
}
});
}
}.withTimeout(getTimoutForTooltipToBeNotVisible(), TimeUnit.MILLISECONDS)
.withMessage("Waiting until some tooltip disappears. There were " + getTooltipsBefore() + " tooltips before, now there are: " + driver.findElements(getTooltipsSelector()).size())
: new WaitingWrapperImpl() {
@Override
protected void performWait(FluentWait<WebDriver, Void> wait) {
wait.until().element(driver, By.id(getIdOfTooltip())).is().not().visible();
}
}.withTimeout(getTimoutForTooltipToBeNotVisible(), TimeUnit.MILLISECONDS)