Skip to content

Commit 2c6dd24

Browse files
abidhahmedDavertMik
authored andcommitted
Fix waitUntilExists for WebdriverIO (#934)
* [Puppeteer] Exit gracefully after test completion * [Puppeteer] Add ability to set user-agent * [Puppeteer] Add keepCookies and keepBrowserState * [Puppeteer] Update documentation * [WebdriverIO] Fix waitUntilExists and update documentation
1 parent e29ea4b commit 2c6dd24

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

lib/helper/WebDriverIO.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ let withinStore = {};
2727
*
2828
* This helper should be configured in codecept.json
2929
*
30-
* * `url` - base url of website to be tested
31-
* * `browser` - browser in which perform testing
32-
* * `restart` (optional, default: true) - restart browser between tests.
33-
* * `smartWait`: (optional) **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000
34-
* * `disableScreenshots` (optional, default: false) - don't save screenshot on failure
35-
* * `uniqueScreenshotNames` (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites
36-
* * `keepBrowserState` (optional, default: false) - keep browser state between tests when `restart` set to false.
37-
* * `keepCookies` (optional, default: false) - keep cookies between tests when `restart` set to false.
30+
* * `url`: base url of website to be tested.
31+
* * `browser`: browser in which to perform testing.
32+
* * `restart`: (optional, default: true) - restart browser between tests.
33+
* * `smartWait`: (optional) **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
34+
* * `disableScreenshots`: (optional, default: false) - don't save screenshots on failure.
35+
* * `uniqueScreenshotNames`: (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites.
36+
* * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to false.
37+
* * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` set to false.
3838
* * `windowSize`: (optional) default window size. Set to `maximize` or a dimension in the format `640x480`.
39-
* * `waitForTimeout`: (option) sets default wait time in *ms* for all `wait*` functions. 1000 by default;
39+
* * `waitForTimeout`: (option) sets default wait time in *ms* for all `wait*` functions. 1000 by default.
4040
* * `desiredCapabilities`: Selenium's [desired
41-
* capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities)
42-
* * `manualStart` (optional, default: false) - do not start browser before a test, start it manually inside a helper
43-
* with `this.helpers["WebDriverIO"]._startBrowser()`
41+
* capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
42+
* * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper
43+
* with `this.helpers["WebDriverIO"]._startBrowser()`.
4444
* * `timeouts`: [WebDriverIO timeouts](http://webdriver.io/guide/testrunner/timeouts.html) defined as hash.
4545
*
4646
* Example:
@@ -1424,7 +1424,8 @@ class WebDriverIO extends Helper {
14241424
* Appium: support
14251425
*/
14261426
async waitUntilExists(locator, sec = null) {
1427-
return this.waitForStalenessOf(locator, sec);
1427+
const aSec = sec || this.options.waitForTimeout;
1428+
return this.browser.waitForExist(locator, aSec * 1000);
14281429
}
14291430

14301431

0 commit comments

Comments
 (0)