diff --git a/test/helpers/selenium-helper.js b/test/helpers/selenium-helper.js index ddafe8704947d664768d89e071c17c481999199a..7063fc555b2053f607af4fca3f1967363bb0c9bd 100644 --- a/test/helpers/selenium-helper.js +++ b/test/helpers/selenium-helper.js @@ -85,7 +85,11 @@ class SeleniumHelper { } findByXpath (xpath, timeoutMessage = `findByXpath timed out for path: ${xpath}`) { - return this.driver.wait(until.elementLocated(By.xpath(xpath)), DEFAULT_TIMEOUT_MILLISECONDS, timeoutMessage); + return this.driver.wait(until.elementLocated(By.xpath(xpath)), DEFAULT_TIMEOUT_MILLISECONDS, timeoutMessage) + .then(el => ( + this.driver.wait(el.isDisplayed(), DEFAULT_TIMEOUT_MILLISECONDS, `${xpath} is not visible`) + .then(() => el) + )); } findByText (text, scope) {