Skip to content
Snippets Groups Projects
Commit 3c47e0e0 authored by BryceLTaylor's avatar BryceLTaylor
Browse files

Make Find by Xpath ensure element is visible in integration tests

parent 34a9a972
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,11 @@ class SeleniumHelper { ...@@ -85,7 +85,11 @@ class SeleniumHelper {
} }
findByXpath (xpath, timeoutMessage = `findByXpath timed out for path: ${xpath}`) { 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) { findByText (text, scope) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment