default ExpectedCondition<Boolean> INVISIBLE(WebElement webElement) { return ExpectedConditions.invisibilityOf(webElement); }
public boolean waitUntilElementDisappear(final long timeout) { try { //TODO: investigate maybe searchContext better to use here! //do direct selenium/appium search without any extra validations if (searchContext != null) { //TODO: use-case when format method is used. Need investigate howto init context in this case as well element = searchContext.findElement(by); } else { LOGGER.error("waitUntilElementDisappear: searchContext is null for " + getNameWithLocator()); element = getDriver().findElement(by); } } catch (NoSuchElementException e) { //element not present so means disappear return true; } catch (Exception e) { //element not present so means disappear LOGGER.error("Investigate use-case with disappeared element later!", e); return true; } return waitUntil(ExpectedConditions.or(ExpectedConditions.invisibilityOfElementLocated(getBy()), ExpectedConditions.stalenessOf(element), ExpectedConditions.invisibilityOf(element)), timeout); }
public Boolean isElemInvisible(WebElement element) { try { return fluentWait.until(invisibilityOf(element)); } catch (Exception e) { return FALSE; } }
private void verifyResultsVisible() { bobcatWait.tweak(Timings.MEDIUM_EXPLICIT).until(invisibilityOf(resultsLoader)); bobcatWait.tweak(Timings.MEDIUM_EXPLICIT).ignoring(StaleElementReferenceException.class) .until(visibilityOfAllElements(searchResults)); }
/** * Activate category suggestions based on the current content of the new category input field. The * first item will be selected and added as a new category. * * @return the name of the newly added category from suggestions */ public String selectFirstSuggestedCategory() { WebElement suggestion = categorySelectModule.findElement(autoCompleteSuggestion); String categoryName = suggestion.getText().trim(); webDriverWait.until(ExpectedConditions.elementToBeClickable(suggestion)); suggestion.click(); webDriverWait.until(ExpectedConditions.invisibilityOf(suggestion)); Log.log("selectCategorySuggestions", "category selected from suggestions", true); return categoryName; }