Skip to content
Snippets Groups Projects
Commit 796339dc authored by Christopher Willis-Ford's avatar Christopher Willis-Ford
Browse files

simplify SeleniumHelper timeout options

parent 1b055af5
No related branches found
No related tags found
No related merge requests found
...@@ -31,11 +31,8 @@ class SeleniumHelper { ...@@ -31,11 +31,8 @@ class SeleniumHelper {
]); ]);
} }
elementIsVisible (element, { elementIsVisible (element, timeoutMessage = 'elementIsVisible timed out') {
message = 'elementIsVisible timed out', return this.driver.wait(until.elementIsVisible(element), DEFAULT_TIMEOUT_MILLISECONDS, timeoutMessage);
timeout = DEFAULT_TIMEOUT_MILLISECONDS
} = {}) {
return this.driver.wait(until.elementIsVisible(element), timeout, message);
} }
get scope () { get scope () {
...@@ -87,11 +84,8 @@ class SeleniumHelper { ...@@ -87,11 +84,8 @@ class SeleniumHelper {
return this.driver; return this.driver;
} }
findByXpath (xpath, { findByXpath (xpath, timeoutMessage = `findByXpath timed out for path: ${xpath}`) {
message = `findByXpath timed out for path: ${xpath}`, return this.driver.wait(until.elementLocated(By.xpath(xpath)), DEFAULT_TIMEOUT_MILLISECONDS, timeoutMessage);
timeout = DEFAULT_TIMEOUT_MILLISECONDS
} = {}) {
return this.driver.wait(until.elementLocated(By.xpath(xpath)), timeout, message);
} }
findByText (text, scope) { findByText (text, scope) {
...@@ -131,11 +125,8 @@ class SeleniumHelper { ...@@ -131,11 +125,8 @@ class SeleniumHelper {
return this.clickXpath(`//button//*[contains(text(), '${text}')]`); return this.clickXpath(`//button//*[contains(text(), '${text}')]`);
} }
waitUntilGone (element, { waitUntilGone (element, timeoutMessage = 'waitUntilGone timed out') {
message = 'waitUntilGone timed out', return this.driver.wait(until.stalenessOf(element), DEFAULT_TIMEOUT_MILLISECONDS, timeoutMessage);
timeout = DEFAULT_TIMEOUT_MILLISECONDS
} = {}) {
return this.driver.wait(until.stalenessOf(element), timeout, message);
} }
getLogs (whitelist) { getLogs (whitelist) {
......
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