UNPKG

webdriverio

Version:

Next-gen browser and mobile automation test framework for Node.js

22 lines (16 loc) 573 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = executeAsync; var _utils = require("../../utils"); function executeAsync(...args) { let script = args.shift(); if (typeof script !== 'string' && typeof script !== 'function') { throw new Error('number or type of arguments don\'t agree with execute protocol command'); } if (typeof script === 'function') { script = `return (${script}).apply(null, arguments)`; } return this.executeAsyncScript(script, (0, _utils.verifyArgsAndStripIfElement)(args)); }