Comparing version 5.16.10 to 5.16.11
@@ -22,4 +22,14 @@ "use strict"; | ||
const scriptTimeout = this.timeouts.get('script'); | ||
script = script.trim(); | ||
if (script.startsWith('return (')) { | ||
script = script.slice(7); | ||
} | ||
if (script.startsWith('return')) { | ||
script = `(function () { ${script} }).apply(null, arguments)`; | ||
} | ||
const result = await page.$eval('html', _executeAsyncScript.default, script, scriptTimeout, _constants.SERIALIZE_PROPERTY, _constants.SERIALIZE_FLAG, ..._utils.transformExecuteArgs.call(this, args)); | ||
return _utils.transformExecuteResult.call(this, page, result); | ||
} |
@@ -22,2 +22,12 @@ "use strict"; | ||
const scriptTimeout = this.timeouts.get('script'); | ||
script = script.trim(); | ||
if (script.startsWith('return (')) { | ||
script = script.slice(7); | ||
} | ||
if (script.startsWith('return')) { | ||
script = `(function () { ${script} }).apply(null, arguments)`; | ||
} | ||
const executePromise = page.$eval('html', _executeScript.default, script, _constants.SERIALIZE_PROPERTY, _constants.SERIALIZE_FLAG, ..._utils.transformExecuteArgs.call(this, args)); | ||
@@ -24,0 +34,0 @@ let executeTimeout; |
@@ -78,2 +78,4 @@ "use strict"; | ||
let retries = 0; | ||
const wrappedCommand = async function (...args) { | ||
@@ -85,2 +87,7 @@ await self.checkPendingNavigations(); | ||
try { | ||
this.emit('command', { | ||
command, | ||
params, | ||
retries | ||
}); | ||
result = await self.commands[command].call(self, params); | ||
@@ -98,2 +105,3 @@ } catch (err) { | ||
}); | ||
++retries; | ||
return wrappedCommand.apply(this, args); | ||
@@ -105,2 +113,8 @@ } | ||
this.emit('result', { | ||
command, | ||
params, | ||
retries, | ||
result | ||
}); | ||
log.info('RESULT', command.toLowerCase().includes('screenshot') && typeof result === 'string' && result.length > 64 ? `${result.substr(0, 61)}...` : result); | ||
@@ -107,0 +121,0 @@ return result; |
@@ -30,3 +30,3 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
@@ -33,0 +33,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
@@ -30,3 +30,3 @@ "use strict"; | ||
}]; | ||
return eval(script.slice(7)); | ||
return eval(script); | ||
}); | ||
@@ -33,0 +33,0 @@ }; |
@@ -10,3 +10,3 @@ "use strict"; | ||
window.arguments = args; | ||
const result = eval(script.slice(7)); | ||
const result = eval(script); | ||
let tmpResult = result instanceof NodeList ? Array.from(result) : result; | ||
@@ -13,0 +13,0 @@ const isResultArray = Array.isArray(tmpResult); |
@@ -9,3 +9,3 @@ "use strict"; | ||
function getElementText(html, elem) { | ||
return elem.textContent; | ||
return elem.innerText; | ||
} |
{ | ||
"name": "devtools", | ||
"version": "5.16.10", | ||
"version": "5.16.11", | ||
"description": "A Chrome DevTools protocol binding that maps WebDriver commands into Chrome DevTools commands using Puppeteer", | ||
@@ -33,6 +33,6 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
"dependencies": { | ||
"@wdio/config": "5.16.10", | ||
"@wdio/config": "5.16.11", | ||
"@wdio/logger": "5.16.10", | ||
"@wdio/protocols": "5.16.7", | ||
"@wdio/utils": "5.16.10", | ||
"@wdio/utils": "5.16.11", | ||
"chrome-launcher": "^0.11.1", | ||
@@ -45,3 +45,3 @@ "puppeteer-core": "^1.18.1", | ||
}, | ||
"gitHead": "e4745ca3e9f615d4e0df7ec4e2b38114ddd51e9d" | ||
"gitHead": "ebea222f90021b0a76b475fcd70a5e1f8ec4dba8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65797
1616
+ Added@wdio/config@5.16.11(transitive)
+ Added@wdio/utils@5.16.11(transitive)
- Removed@wdio/config@5.16.10(transitive)
- Removed@wdio/utils@5.16.10(transitive)
Updated@wdio/config@5.16.11
Updated@wdio/utils@5.16.11