Skip to content

Commit

Permalink
fix: migration errors in wait methods (#65)
Browse files Browse the repository at this point in the history
* chore: update versions

* fix migration issues

* fix: fix incorrect specs

* fix: incorrect migration of wait methods
  • Loading branch information
vilkg authored Dec 2, 2020
1 parent 50a0d05 commit 46d44ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "DHIS2 E2E testing",
"dependencies": {
"@wdio/allure-reporter": "^5.16.0",
"@wdio/allure-reporter": "^6.8.1",
"@wdio/browserstack-service": "^6.10.4",
"@wdio/cli": "^6.10.5",
"@wdio/cucumber-framework": "^6.10.4",
Expand Down
6 changes: 3 additions & 3 deletions support/wait/waitForVisible.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* Wait for the given element to become visible
* @param {String} elem Element selector
* @param {String} falseCase Whether or not to expect a visible or hidden
* @param {String} reverse Whether or not to expect a visible or hidden
* state
*
* @todo merge with waitfor
*/
module.exports = (elem, falseCase) => {
module.exports = (elem, reverse) => {
/**
* Maximum number of milliseconds to wait for
* @type {Int}
*/
const ms = 10000;
elem.waitForDisplayed(ms, !!falseCase);
elem.waitForDisplayed(ms, {reverse: reverse});
};
11 changes: 8 additions & 3 deletions support/wait/waitForWindowToLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ module.exports = () => {
return false;
}
}
browser.waitUntil(() => {
return check()
}, 40000, 'Page didnt load in 40s', 700)

browser.waitUntil(
() => { return check()},
{
timeout: 40000,
timeoutMsg: 'Page didnt load in 40s',
interval: 700
})
}

0 comments on commit 46d44ce

Please sign in to comment.