Created
May 30, 2019 20:57
-
-
Save jgoldring/b2cd473773fe51ca8d517012e8508af4 to your computer and use it in GitHub Desktop.
Example wdio config file where onComplete does not wait for the async operation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.config = { | |
runner: 'local', | |
specs: [ 'test.js'], | |
maxInstances: 2, | |
exclude: [], | |
hostname: 'localhost', | |
port: 4444, | |
path: '/wd/hub', | |
capabilities: [ | |
{ | |
browserName: 'chrome', | |
"goog:chromeOptions" : { | |
"args" : [ | |
"no-sandbox" | |
] | |
} | |
} | |
], | |
outputDir: './wdiologs/', | |
deprecationWarnings: true, | |
bail: 0, | |
logLevel: 'info', | |
coloredLogs: true, | |
waitforTimeout: 10000, | |
connectionRetryTimeout: 20000, | |
connectionRetryCount: 3, | |
framework: 'mocha', | |
mochaOpts: { | |
ui: 'bdd' | |
}, | |
onPrepare: async function(config, capabilities) { | |
console.log("onPrepare() - Pre 10s Wait: " + Date.now()); | |
await new Promise(resolve => setTimeout(resolve, 10000)); | |
console.log("onPrepare() - Post 10s Wait: " + Date.now()); | |
}, | |
onComplete: async function (exitCode, config, capabilities, results) { | |
console.log("onComplete() - Pre 10s Wait: " + Date.now()); | |
await new Promise(resolve => setTimeout(resolve, 10000)); | |
console.log("onComplete() - Post 10s Wait: " + Date.now()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment