diff options
Diffstat (limited to 'integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java')
-rw-r--r-- | integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java index 06c32801d6..2564d0dd74 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java @@ -163,4 +163,34 @@ public abstract class AbstractPageObject implements PageObject { .until(ExpectedConditions.invisibilityOfElementLocated(locator)); } + /** + * Waits for element invisibility with the provided timeout. + * + * @param locator the By locator to search for the element + * @param timeoutInSeconds the wait timeout in seconds + * @return the WebElement if invisible before timeout, false otherwise + */ + protected Boolean waitForElementInvisibility(final By locator, final int timeoutInSeconds) { + return getWait(timeoutInSeconds) + .until(ExpectedConditions.invisibilityOfElementLocated(locator)); + } + + /** + * Waits elements to be clickable with the default timeout. + * @param xpath the xpath to find the element(s) + * @return the WebElement if clickable before timeout, otherwise throws an exception + */ + protected WebElement waitToBeClickable(final String xpath) { + return waitToBeClickable(By.xpath(xpath)); + } + + /** + * Waits elements to be clickable with the default timeout. + * @param locator the By locator to search for the element(s) + * @return the WebElement if clickable before timeout, otherwise throws an exception + */ + protected WebElement waitToBeClickable(final By locator) { + return getWait().until(ExpectedConditions.elementToBeClickable(locator)); + } + } |