@wdio/runner
Advanced tools
Comparing version 5.8.6 to 5.9.0
@@ -316,6 +316,19 @@ "use strict"; | ||
/** | ||
* make sure instance(s) exist and have `sessionId` | ||
*/ | ||
const hasSessionId = global.browser && (this.isMultiremote | ||
/** | ||
* every multiremote instance should exist and should have `sessionId` | ||
*/ | ||
? !global.browser.instances.some(i => global.browser[i] && !global.browser[i].sessionId) | ||
/** | ||
* browser object should have `sessionId` in regular mode | ||
*/ | ||
: global.browser.sessionId); | ||
/** | ||
* don't do anything if test framework returns after SIGINT | ||
* if endSession is called without shutdown flag we expect a session id | ||
*/ | ||
if (!shutdown && (!global.browser || !global.browser.sessionId)) { | ||
if (!shutdown && !hasSessionId) { | ||
return; | ||
@@ -329,10 +342,32 @@ } | ||
if (shutdown && (!global.browser || !global.browser.sessionId)) { | ||
if (shutdown && !hasSessionId) { | ||
await new Promise(resolve => setTimeout(resolve, 250)); | ||
return this.endSession(shutdown); | ||
} | ||
/** | ||
* store capabilities for afterSession hook | ||
*/ | ||
const capabilities = global.browser.capabilities; | ||
let capabilities = global.browser.capabilities || {}; | ||
if (this.isMultiremote) { | ||
global.browser.instances.forEach(i => { | ||
capabilities[i] = global.browser[i].capabilities; | ||
}); | ||
} | ||
await global.browser.deleteSession(); | ||
delete global.browser.sessionId; | ||
/** | ||
* delete session(s) | ||
*/ | ||
if (this.isMultiremote) { | ||
global.browser.instances.forEach(i => { | ||
delete global.browser[i].sessionId; | ||
}); | ||
} else { | ||
delete global.browser.sessionId; | ||
} | ||
await (0, _utils2.runHook)('afterSession', global.browser.config, capabilities, this.specs); | ||
@@ -339,0 +374,0 @@ |
{ | ||
"name": "@wdio/runner", | ||
"version": "5.8.6", | ||
"version": "5.9.0", | ||
"description": "A WebdriverIO service that runs tests in arbitrary environments", | ||
@@ -33,8 +33,8 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
"dependencies": { | ||
"@wdio/config": "^5.8.1", | ||
"@wdio/logger": "^5.8.0", | ||
"@wdio/utils": "^5.8.1", | ||
"@wdio/config": "^5.9.0", | ||
"@wdio/logger": "^5.9.0", | ||
"@wdio/utils": "^5.9.0", | ||
"deepmerge": "^2.0.1", | ||
"gaze": "^1.1.2", | ||
"webdriverio": "^5.8.6" | ||
"webdriverio": "^5.9.0" | ||
}, | ||
@@ -44,3 +44,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "4d9b701c1c44ccabd8461eab79c98900cd9fa962" | ||
"gitHead": "6339dc411df997530375eda47b8a4b735bcd6c2c" | ||
} |
20528
576
Updated@wdio/config@^5.9.0
Updated@wdio/logger@^5.9.0
Updated@wdio/utils@^5.9.0
Updatedwebdriverio@^5.9.0