@wdio/sync
Advanced tools
Comparing version 5.11.9 to 5.11.10
@@ -39,6 +39,7 @@ "use strict"; | ||
* all named nested functions run in parent Fiber context | ||
* except of debug | ||
*/ | ||
this._NOT_FIBER = fn.name !== ''; | ||
this._NOT_FIBER = fn.name !== '' && fn.name !== 'debug'; | ||
const future = new _future.default(); | ||
@@ -50,3 +51,3 @@ const result = runCommandWithHooks.apply(this, [commandName, fn, stackError, ...args]); | ||
const futureResult = future.wait(); | ||
this._NOT_FIBER = false; | ||
inFiber(this); | ||
return futureResult; | ||
@@ -70,3 +71,3 @@ } catch (e) { | ||
this._NOT_FIBER = false; | ||
inFiber(this); | ||
throw e; | ||
@@ -118,2 +119,17 @@ } | ||
return fnName !== '' && !!(context.elementId || context.parent && context.parent.elementId); | ||
} | ||
/** | ||
* set `_NOT_FIBER` to `false` for element and its parents | ||
* @param {object} context browser or element | ||
*/ | ||
function inFiber(context) { | ||
context._NOT_FIBER = false; | ||
let parent = context.parent; | ||
while (parent && parent._NOT_FIBER) { | ||
parent._NOT_FIBER = false; | ||
parent = parent.parent; | ||
} | ||
} |
{ | ||
"name": "@wdio/sync", | ||
"version": "5.11.9", | ||
"version": "5.11.10", | ||
"description": "A WebdriverIO plugin. Helper module to run WebdriverIO commands synchronously", | ||
@@ -44,3 +44,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "a2d869d56d4f9a2fd4dd99d653c5cba6a6f943dc" | ||
"gitHead": "644a371a294292fae1d866d14d0e42dd75156c68" | ||
} |
31104
861