@wdio/cli 7.14.1 → 7.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/config.js +19 -19
- package/build/commands/install.js +8 -8
- package/build/commands/repl.d.ts +0 -13
- package/build/commands/repl.d.ts.map +1 -1
- package/build/commands/repl.js +5 -3
- package/build/commands/run.d.ts +1 -1
- package/build/commands/run.js +1 -1
- package/build/constants.js +7 -7
- package/build/index.js +1 -1
- package/build/interface.d.ts.map +1 -1
- package/build/interface.js +2 -2
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +16 -11
- package/build/templates/afterTest.ejs +8 -1
- package/build/templates/wdio.conf.tpl.ejs +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +17 -13
- package/build/watcher.js +5 -5
- package/package.json +8 -8
package/build/commands/config.js
CHANGED
|
@@ -18,7 +18,7 @@ exports.cmdArgs = {
|
|
|
18
18
|
yarn: {
|
|
19
19
|
type: 'boolean',
|
|
20
20
|
desc: 'Install packages via yarn package manager.',
|
|
21
|
-
default: utils_1.hasFile('yarn.lock')
|
|
21
|
+
default: (0, utils_1.hasFile)('yarn.lock')
|
|
22
22
|
},
|
|
23
23
|
yes: {
|
|
24
24
|
alias: 'y',
|
|
@@ -36,11 +36,11 @@ const builder = (yargs) => {
|
|
|
36
36
|
exports.builder = builder;
|
|
37
37
|
const runConfig = async function (useYarn, yes, exit = false) {
|
|
38
38
|
console.log(constants_1.CONFIG_HELPER_INTRO);
|
|
39
|
-
const answers = await utils_1.getAnswers(yes);
|
|
40
|
-
const frameworkPackage = utils_1.convertPackageHashToObject(answers.framework);
|
|
41
|
-
const runnerPackage = utils_1.convertPackageHashToObject(answers.runner || constants_1.SUPPORTED_PACKAGES.runner[0].value);
|
|
42
|
-
const servicePackages = answers.services.map((service) => utils_1.convertPackageHashToObject(service));
|
|
43
|
-
const reporterPackages = answers.reporters.map((reporter) => utils_1.convertPackageHashToObject(reporter));
|
|
39
|
+
const answers = await (0, utils_1.getAnswers)(yes);
|
|
40
|
+
const frameworkPackage = (0, utils_1.convertPackageHashToObject)(answers.framework);
|
|
41
|
+
const runnerPackage = (0, utils_1.convertPackageHashToObject)(answers.runner || constants_1.SUPPORTED_PACKAGES.runner[0].value);
|
|
42
|
+
const servicePackages = answers.services.map((service) => (0, utils_1.convertPackageHashToObject)(service));
|
|
43
|
+
const reporterPackages = answers.reporters.map((reporter) => (0, utils_1.convertPackageHashToObject)(reporter));
|
|
44
44
|
let packagesToInstall = [
|
|
45
45
|
runnerPackage.package,
|
|
46
46
|
frameworkPackage.package,
|
|
@@ -51,10 +51,10 @@ const runConfig = async function (useYarn, yes, exit = false) {
|
|
|
51
51
|
* add ts-node if TypeScript is desired but not installed
|
|
52
52
|
*/
|
|
53
53
|
if (answers.isUsingCompiler === constants_1.COMPILER_OPTIONS.ts) {
|
|
54
|
-
if (!utils_1.hasPackage('ts-node')) {
|
|
54
|
+
if (!(0, utils_1.hasPackage)('ts-node')) {
|
|
55
55
|
packagesToInstall.push('ts-node', 'typescript');
|
|
56
56
|
}
|
|
57
|
-
if (!utils_1.hasFile('tsconfig.json')) {
|
|
57
|
+
if (!(0, utils_1.hasFile)('tsconfig.json')) {
|
|
58
58
|
const config = {
|
|
59
59
|
compilerOptions: {
|
|
60
60
|
types: [
|
|
@@ -73,17 +73,17 @@ const runConfig = async function (useYarn, yes, exit = false) {
|
|
|
73
73
|
* add @babel/register package if not installed
|
|
74
74
|
*/
|
|
75
75
|
if (answers.isUsingCompiler === constants_1.COMPILER_OPTIONS.babel) {
|
|
76
|
-
if (!utils_1.hasPackage('@babel/register')) {
|
|
76
|
+
if (!(0, utils_1.hasPackage)('@babel/register')) {
|
|
77
77
|
packagesToInstall.push('@babel/register');
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* setup Babel if no config file exists
|
|
81
81
|
*/
|
|
82
|
-
if (!utils_1.hasFile('babel.config.js')) {
|
|
83
|
-
if (!utils_1.hasPackage('@babel/core')) {
|
|
82
|
+
if (!(0, utils_1.hasFile)('babel.config.js')) {
|
|
83
|
+
if (!(0, utils_1.hasPackage)('@babel/core')) {
|
|
84
84
|
packagesToInstall.push('@babel/core');
|
|
85
85
|
}
|
|
86
|
-
if (!utils_1.hasPackage('@babel/preset-env')) {
|
|
86
|
+
if (!(0, utils_1.hasPackage)('@babel/preset-env')) {
|
|
87
87
|
packagesToInstall.push('@babel/preset-env');
|
|
88
88
|
}
|
|
89
89
|
await fs_1.default.promises.writeFile(path_1.default.join(process.cwd(), 'babel.config.js'), `module.exports = ${JSON.stringify({
|
|
@@ -100,7 +100,7 @@ const runConfig = async function (useYarn, yes, exit = false) {
|
|
|
100
100
|
/**
|
|
101
101
|
* add packages that are required by services
|
|
102
102
|
*/
|
|
103
|
-
utils_1.addServiceDeps(servicePackages, packagesToInstall);
|
|
103
|
+
(0, utils_1.addServiceDeps)(servicePackages, packagesToInstall);
|
|
104
104
|
/**
|
|
105
105
|
* ensure wdio packages have the same dist tag as cli
|
|
106
106
|
*/
|
|
@@ -112,7 +112,7 @@ const runConfig = async function (useYarn, yes, exit = false) {
|
|
|
112
112
|
: p);
|
|
113
113
|
}
|
|
114
114
|
console.log('\nInstalling wdio packages:\n-', packagesToInstall.join('\n- '));
|
|
115
|
-
const result = yarn_install_1.default({ deps: packagesToInstall, dev: true, respectNpm5: !useYarn });
|
|
115
|
+
const result = (0, yarn_install_1.default)({ deps: packagesToInstall, dev: true, respectNpm5: !useYarn });
|
|
116
116
|
if (result.status !== 0) {
|
|
117
117
|
const customError = 'An unknown error happened! Please retry ' +
|
|
118
118
|
`installing dependencies via "${useYarn ? 'yarn add --dev' : 'npm i --save-dev'} ` +
|
|
@@ -131,7 +131,7 @@ const runConfig = async function (useYarn, yes, exit = false) {
|
|
|
131
131
|
/**
|
|
132
132
|
* find relative paths between tests and pages
|
|
133
133
|
*/
|
|
134
|
-
const parsedPaths = utils_1.getPathForFileGeneration(answers);
|
|
134
|
+
const parsedPaths = (0, utils_1.getPathForFileGeneration)(answers);
|
|
135
135
|
const parsedAnswers = {
|
|
136
136
|
...answers,
|
|
137
137
|
runner: runnerPackage.short,
|
|
@@ -149,14 +149,14 @@ const runConfig = async function (useYarn, yes, exit = false) {
|
|
|
149
149
|
relativePath: parsedPaths.relativePath
|
|
150
150
|
};
|
|
151
151
|
try {
|
|
152
|
-
await utils_1.renderConfigurationFile(parsedAnswers);
|
|
152
|
+
await (0, utils_1.renderConfigurationFile)(parsedAnswers);
|
|
153
153
|
if (answers.generateTestFiles) {
|
|
154
154
|
console.log('\nConfig file installed successfully, creating test files...');
|
|
155
|
-
await utils_1.generateTestFiles(parsedAnswers);
|
|
155
|
+
await (0, utils_1.generateTestFiles)(parsedAnswers);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
catch (
|
|
159
|
-
throw new Error(`Couldn't write config file: ${
|
|
158
|
+
catch (err) {
|
|
159
|
+
throw new Error(`Couldn't write config file: ${err.stack}`);
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* print TypeScript configuration message
|
|
@@ -12,9 +12,9 @@ const utils_1 = require("../utils");
|
|
|
12
12
|
const config_1 = require("./config");
|
|
13
13
|
const constants_1 = require("../constants");
|
|
14
14
|
const supportedInstallations = {
|
|
15
|
-
service: constants_1.SUPPORTED_PACKAGES.service.map(({ value }) => utils_1.convertPackageHashToObject(value)),
|
|
16
|
-
reporter: constants_1.SUPPORTED_PACKAGES.reporter.map(({ value }) => utils_1.convertPackageHashToObject(value)),
|
|
17
|
-
framework: constants_1.SUPPORTED_PACKAGES.framework.map(({ value }) => utils_1.convertPackageHashToObject(value))
|
|
15
|
+
service: constants_1.SUPPORTED_PACKAGES.service.map(({ value }) => (0, utils_1.convertPackageHashToObject)(value)),
|
|
16
|
+
reporter: constants_1.SUPPORTED_PACKAGES.reporter.map(({ value }) => (0, utils_1.convertPackageHashToObject)(value)),
|
|
17
|
+
framework: constants_1.SUPPORTED_PACKAGES.framework.map(({ value }) => (0, utils_1.convertPackageHashToObject)(value))
|
|
18
18
|
};
|
|
19
19
|
exports.command = 'install <type> <name>';
|
|
20
20
|
exports.desc = [
|
|
@@ -74,7 +74,7 @@ async function handler(argv) {
|
|
|
74
74
|
try {
|
|
75
75
|
const promptMessage = `Cannot install packages without a WebdriverIO configuration.
|
|
76
76
|
You can create one by running 'wdio config'`;
|
|
77
|
-
await config_1.missingConfigurationPrompt('install', promptMessage, yarn);
|
|
77
|
+
await (0, config_1.missingConfigurationPrompt)('install', promptMessage, yarn);
|
|
78
78
|
}
|
|
79
79
|
catch {
|
|
80
80
|
process.exit(1);
|
|
@@ -82,7 +82,7 @@ You can create one by running 'wdio config'`;
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
const configFile = fs_extra_1.default.readFileSync(localConfPath, { encoding: 'utf-8' });
|
|
85
|
-
const match = utils_1.findInConfig(configFile, type);
|
|
85
|
+
const match = (0, utils_1.findInConfig)(configFile, type);
|
|
86
86
|
if (match && match[0].includes(name)) {
|
|
87
87
|
console.log(`The ${type} ${name} is already part of your configuration.`);
|
|
88
88
|
process.exit(0);
|
|
@@ -90,16 +90,16 @@ You can create one by running 'wdio config'`;
|
|
|
90
90
|
}
|
|
91
91
|
const selectedPackage = supportedInstallations[type].find(({ short }) => short === name);
|
|
92
92
|
const pkgsToInstall = selectedPackage ? [selectedPackage.package] : [];
|
|
93
|
-
utils_1.addServiceDeps(selectedPackage ? [selectedPackage] : [], pkgsToInstall, true);
|
|
93
|
+
(0, utils_1.addServiceDeps)(selectedPackage ? [selectedPackage] : [], pkgsToInstall, true);
|
|
94
94
|
console.log(`Installing "${selectedPackage.package}"${yarn ? ' using yarn.' : '.'}`);
|
|
95
|
-
const install = yarn_install_1.default({ deps: pkgsToInstall, dev: true, respectNpm5: !yarn }); // use !yarn so the package forces npm install
|
|
95
|
+
const install = (0, yarn_install_1.default)({ deps: pkgsToInstall, dev: true, respectNpm5: !yarn }); // use !yarn so the package forces npm install
|
|
96
96
|
if (install.status !== 0) {
|
|
97
97
|
console.error('Error installing packages', install.stderr);
|
|
98
98
|
process.exit(1);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
console.log(`Package "${selectedPackage.package}" installed successfully.`);
|
|
102
|
-
const newConfig = utils_1.replaceConfig(configFile, type, name);
|
|
102
|
+
const newConfig = (0, utils_1.replaceConfig)(configFile, type, name);
|
|
103
103
|
if (!newConfig) {
|
|
104
104
|
throw new Error(`Couldn't find "${type}" property in ${path_1.default.basename(localConfPath)}`);
|
|
105
105
|
}
|
package/build/commands/repl.d.ts
CHANGED
|
@@ -32,18 +32,5 @@ export declare const builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{
|
|
|
32
32
|
readonly desc: "UDID of real mobile devices";
|
|
33
33
|
readonly type: "string";
|
|
34
34
|
}>>>;
|
|
35
|
-
/**
|
|
36
|
-
* user types for globals are set in webdriverio
|
|
37
|
-
* putting this here to make compiler happy
|
|
38
|
-
*/
|
|
39
|
-
declare global {
|
|
40
|
-
namespace NodeJS {
|
|
41
|
-
interface Global {
|
|
42
|
-
$: any;
|
|
43
|
-
$$: any;
|
|
44
|
-
browser: any;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
35
|
export declare const handler: (argv: ReplCommandArguments) => Promise<any>;
|
|
49
36
|
//# sourceMappingURL=repl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/commands/repl.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,OAAO,iCAAiC,CAAA;AACrD,eAAO,MAAM,IAAI,0CAA0C,CAAA;AAC3D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;CAgBV,CAAA;AAEV,eAAO,MAAM,OAAO;;;;;;;;;;;;IAUnB,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/commands/repl.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,OAAO,iCAAiC,CAAA;AACrD,eAAO,MAAM,IAAI,0CAA0C,CAAA;AAC3D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;CAgBV,CAAA;AAEV,eAAO,MAAM,OAAO;;;;;;;;;;;;IAUnB,CAAA;AAED,eAAO,MAAM,OAAO,SAAgB,oBAAoB,iBAiBvD,CAAA"}
|
package/build/commands/repl.js
CHANGED
|
@@ -34,7 +34,7 @@ exports.cmdArgs = {
|
|
|
34
34
|
};
|
|
35
35
|
const builder = (yargs) => {
|
|
36
36
|
return yargs
|
|
37
|
-
.options(lodash_pickby_1.default(exports.cmdArgs, (_, key) => !IGNORED_ARGS.includes(key)))
|
|
37
|
+
.options((0, lodash_pickby_1.default)(exports.cmdArgs, (_, key) => !IGNORED_ARGS.includes(key)))
|
|
38
38
|
.example('$0 repl firefox --path /', 'Run repl locally')
|
|
39
39
|
.example('$0 repl chrome -u <SAUCE_USERNAME> -k <SAUCE_ACCESS_KEY>', 'Run repl in Sauce Labs cloud')
|
|
40
40
|
.example('$0 repl android', 'Run repl browser on launched Android device')
|
|
@@ -45,13 +45,15 @@ const builder = (yargs) => {
|
|
|
45
45
|
};
|
|
46
46
|
exports.builder = builder;
|
|
47
47
|
const handler = async (argv) => {
|
|
48
|
-
const caps = utils_2.getCapabilities(argv);
|
|
48
|
+
const caps = (0, utils_2.getCapabilities)(argv);
|
|
49
49
|
/**
|
|
50
50
|
* runner option required to wrap commands within Fibers context
|
|
51
51
|
*/
|
|
52
52
|
const execMode = utils_1.hasWdioSyncSupport ? { runner: 'local' } : {};
|
|
53
|
-
const client = await webdriverio_1.remote({ ...argv, ...caps, ...execMode });
|
|
53
|
+
const client = await (0, webdriverio_1.remote)({ ...argv, ...caps, ...execMode });
|
|
54
|
+
// @ts-ignore
|
|
54
55
|
global.$ = client.$.bind(client);
|
|
56
|
+
// @ts-ignore
|
|
55
57
|
global.$$ = client.$$.bind(client);
|
|
56
58
|
global.browser = client;
|
|
57
59
|
await client.debug();
|
package/build/commands/run.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export declare const cmdArgs: {
|
|
|
84
84
|
readonly desc: "Auto compilation options";
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
export declare const builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, "framework" | "reporters" | "hostname" | "port" | "path" | "baseUrl" | "
|
|
87
|
+
export declare const builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, "framework" | "reporters" | "hostname" | "port" | "path" | "baseUrl" | "exclude" | "user" | "key" | "logLevel" | "spec" | "waitforTimeout" | "watch" | "bail" | "suite" | "mochaOpts" | "jasmineOpts" | "cucumberOpts" | "autoCompileOpts"> & yargs.InferredOptionTypes<{
|
|
88
88
|
readonly watch: {
|
|
89
89
|
readonly desc: "Run WebdriverIO in watch mode";
|
|
90
90
|
readonly type: "boolean";
|
package/build/commands/run.js
CHANGED
|
@@ -142,7 +142,7 @@ exports.launch = launch;
|
|
|
142
142
|
async function handler(argv) {
|
|
143
143
|
const { configPath, ...params } = argv;
|
|
144
144
|
if (!fs_extra_1.default.existsSync(configPath)) {
|
|
145
|
-
await config_1.missingConfigurationPrompt('run', `No WebdriverIO configuration found in "${process.cwd()}"`);
|
|
145
|
+
await (0, config_1.missingConfigurationPrompt)('run', `No WebdriverIO configuration found in "${process.cwd()}"`);
|
|
146
146
|
}
|
|
147
147
|
const localConf = path_1.default.join(process.cwd(), 'wdio.conf.js');
|
|
148
148
|
const wdioConf = configPath || (fs_extra_1.default.existsSync(localConf) ? localConf : undefined);
|
package/build/constants.js
CHANGED
|
@@ -262,16 +262,16 @@ exports.QUESTIONNAIRE = [{
|
|
|
262
262
|
name: 'isUsingCompiler',
|
|
263
263
|
message: 'Do you want to use a compiler?',
|
|
264
264
|
choices: exports.COMPILER_OPTION_ANSWERS,
|
|
265
|
-
default: /* istanbul ignore next */ () => utils_1.hasFile('babel.config.js')
|
|
265
|
+
default: /* istanbul ignore next */ () => (0, utils_1.hasFile)('babel.config.js')
|
|
266
266
|
? exports.COMPILER_OPTIONS.babel // default to Babel
|
|
267
|
-
: utils_1.hasFile('tsconfig.json')
|
|
267
|
+
: (0, utils_1.hasFile)('tsconfig.json')
|
|
268
268
|
? exports.COMPILER_OPTIONS.ts // default to TypeScript
|
|
269
269
|
: exports.COMPILER_OPTIONS.nil // default to no compiler
|
|
270
270
|
}, {
|
|
271
271
|
type: 'input',
|
|
272
272
|
name: 'specs',
|
|
273
273
|
message: 'Where are your test specs located?',
|
|
274
|
-
default: (answers) => utils_1.getDefaultFiles(answers, './test/specs/**/*'),
|
|
274
|
+
default: (answers) => (0, utils_1.getDefaultFiles)(answers, './test/specs/**/*'),
|
|
275
275
|
when: /* istanbul ignore next */ (answers) => answers.framework.match(/(mocha|jasmine)/)
|
|
276
276
|
}, {
|
|
277
277
|
type: 'input',
|
|
@@ -283,7 +283,7 @@ exports.QUESTIONNAIRE = [{
|
|
|
283
283
|
type: 'input',
|
|
284
284
|
name: 'stepDefinitions',
|
|
285
285
|
message: 'Where are your step definitions located?',
|
|
286
|
-
default: (answers) => utils_1.getDefaultFiles(answers, './features/step-definitions/steps'),
|
|
286
|
+
default: (answers) => (0, utils_1.getDefaultFiles)(answers, './features/step-definitions/steps'),
|
|
287
287
|
when: /* istanbul ignore next */ (answers) => answers.framework.includes('cucumber')
|
|
288
288
|
}, {
|
|
289
289
|
type: 'confirm',
|
|
@@ -301,8 +301,8 @@ exports.QUESTIONNAIRE = [{
|
|
|
301
301
|
name: 'pages',
|
|
302
302
|
message: 'Where are your page objects located?',
|
|
303
303
|
default: /* istanbul ignore next */ (answers) => (answers.framework.match(/(mocha|jasmine)/)
|
|
304
|
-
? utils_1.getDefaultFiles(answers, './test/pageobjects/**/*')
|
|
305
|
-
: utils_1.getDefaultFiles(answers, './features/pageobjects/**/*')),
|
|
304
|
+
? (0, utils_1.getDefaultFiles)(answers, './test/pageobjects/**/*')
|
|
305
|
+
: (0, utils_1.getDefaultFiles)(answers, './features/pageobjects/**/*')),
|
|
306
306
|
when: /* istanbul ignore next */ (answers) => answers.generateTestFiles && answers.usePageObjects
|
|
307
307
|
}, {
|
|
308
308
|
type: 'checkbox',
|
|
@@ -324,7 +324,7 @@ exports.QUESTIONNAIRE = [{
|
|
|
324
324
|
/* istanbul ignore next */
|
|
325
325
|
({ name }) => name === 'chromedriver').value
|
|
326
326
|
],
|
|
327
|
-
validate: /* istanbul ignore next */ (answers) => utils_1.validateServiceAnswers(answers)
|
|
327
|
+
validate: /* istanbul ignore next */ (answers) => (0, utils_1.validateServiceAnswers)(answers)
|
|
328
328
|
}, {
|
|
329
329
|
type: 'input',
|
|
330
330
|
name: 'outputDir',
|
package/build/index.js
CHANGED
|
@@ -69,7 +69,7 @@ const run = async () => {
|
|
|
69
69
|
...argv.argv,
|
|
70
70
|
configPath: path_1.default.resolve(process.cwd(), argv.argv._[0] && argv.argv._[0].toString() || DEFAULT_CONFIG_FILENAME)
|
|
71
71
|
};
|
|
72
|
-
return run_1.handler(args).catch(async (err) => {
|
|
72
|
+
return (0, run_1.handler)(args).catch(async (err) => {
|
|
73
73
|
const output = await new Promise((resolve) => (yargs_1.default.parse('--help', (err, argv, output) => resolve(output))));
|
|
74
74
|
console.error(`${output}\n\n${err.stack}`);
|
|
75
75
|
/* istanbul ignore if */
|
package/build/interface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,KAAK,EAAE,OAAO,EAAgB,OAAO,EAAE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OAAO,EAAE,iBAAiB;IAUvC,YAAY,CAAE,KAAK,GAAE,MAAM,EAAO;IAOlC;;OAEG;IACH,MAAM,CAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,GAAG,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE;IASrE;;OAEG;IACH,QAAQ,CAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IA2BrF;;OAEG;IACH,GAAG,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAMnB;;OAEG;IACH,SAAS,CAAE,KAAK,EAAE,iBAAiB;IA0CnC,aAAa;IAgBb,cAAc;IAYd,YAAY;IAaZ,QAAQ;CAQX"}
|
package/build/interface.js
CHANGED
|
@@ -7,7 +7,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
7
7
|
const events_1 = require("events");
|
|
8
8
|
const logger_1 = __importDefault(require("@wdio/logger"));
|
|
9
9
|
const utils_1 = require("./utils");
|
|
10
|
-
const log = logger_1.default('@wdio/cli');
|
|
10
|
+
const log = (0, logger_1.default)('@wdio/cli');
|
|
11
11
|
class WDIOCLInterface extends events_1.EventEmitter {
|
|
12
12
|
constructor(_config, totalWorkerCnt, _isWatchMode = false) {
|
|
13
13
|
super();
|
|
@@ -90,7 +90,7 @@ class WDIOCLInterface extends events_1.EventEmitter {
|
|
|
90
90
|
onJobComplete(cid, job, retries = 0, message = '', _logger = this.log) {
|
|
91
91
|
const details = [`[${cid}]`, message];
|
|
92
92
|
if (job) {
|
|
93
|
-
details.push('in', utils_1.getRunnerName(job.caps), this.getFilenames(job.specs));
|
|
93
|
+
details.push('in', (0, utils_1.getRunnerName)(job.caps), this.getFilenames(job.specs));
|
|
94
94
|
}
|
|
95
95
|
if (retries > 0) {
|
|
96
96
|
details.push(`(${retries} retries)`);
|
package/build/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,WAAW,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAmB7C,UAAU,UAAU;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,cAAM,QAAQ;IAiBN,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,YAAY;IAlBxB,YAAY,EAAE,YAAY,CAAA;IAC1B,aAAa,EAAE,OAAO,CAAA;IACtB,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAA;IAC/B,SAAS,EAAE,WAAW,CAAA;IAEtB,OAAO,CAAC,SAAS,CAAI;IACrB,OAAO,CAAC,wBAAwB,CAAQ;IACxC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,aAAa,CAAI;IAEzB,OAAO,CAAC,SAAS,CAAC,CAA4B;IAC9C,OAAO,CAAC,QAAQ,CAAC,CAAU;gBAGf,eAAe,EAAE,MAAM,EACvB,KAAK,GAAE,OAAO,CAAC,mBAAmB,CAAM,EACxC,YAAY,UAAQ;IA8ChC;;;OAGG;IACG,GAAG;IA2DT;;OAEG;IACH,OAAO,CAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,YA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c7C;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CAG7B;AAED,eAAe,QAAQ,CAAA"}
|
package/build/launcher.js
CHANGED
|
@@ -11,7 +11,7 @@ const config_1 = require("@wdio/config");
|
|
|
11
11
|
const utils_1 = require("@wdio/utils");
|
|
12
12
|
const interface_1 = __importDefault(require("./interface"));
|
|
13
13
|
const utils_2 = require("./utils");
|
|
14
|
-
const log = logger_1.default('@wdio/cli:launcher');
|
|
14
|
+
const log = (0, logger_1.default)('@wdio/cli:launcher');
|
|
15
15
|
class Launcher {
|
|
16
16
|
constructor(_configFilePath, _args = {}, _isWatchMode = false) {
|
|
17
17
|
this._configFilePath = _configFilePath;
|
|
@@ -51,7 +51,7 @@ class Launcher {
|
|
|
51
51
|
.map((c) => this.configParser.getSpecs(c.specs, c.exclude).length)
|
|
52
52
|
.reduce((a, b) => a + b, 0)
|
|
53
53
|
: 1;
|
|
54
|
-
const Runner = utils_1.initialisePlugin(config.runner, 'runner').default;
|
|
54
|
+
const Runner = (0, utils_1.initialisePlugin)(config.runner, 'runner').default;
|
|
55
55
|
this.runner = new Runner(_configFilePath, config);
|
|
56
56
|
this.interface = new interface_1.default(config, totalWorkerCnt, this._isWatchMode);
|
|
57
57
|
config.runnerEnv.FORCE_COLOR = Number(this.interface.hasAnsiSupport);
|
|
@@ -64,13 +64,13 @@ class Launcher {
|
|
|
64
64
|
/**
|
|
65
65
|
* catches ctrl+c event
|
|
66
66
|
*/
|
|
67
|
-
async_exit_hook_1.default(this.exitHandler.bind(this));
|
|
67
|
+
(0, async_exit_hook_1.default)(this.exitHandler.bind(this));
|
|
68
68
|
let exitCode = 0;
|
|
69
69
|
let error = undefined;
|
|
70
70
|
try {
|
|
71
71
|
const config = this.configParser.getConfig();
|
|
72
72
|
const caps = this.configParser.getCapabilities();
|
|
73
|
-
const { ignoredWorkerServices, launcherServices } = utils_1.initialiseLauncherService(config, caps);
|
|
73
|
+
const { ignoredWorkerServices, launcherServices } = (0, utils_1.initialiseLauncherService)(config, caps);
|
|
74
74
|
this._launcher = launcherServices;
|
|
75
75
|
this._args.ignoredWorkerServices = ignoredWorkerServices;
|
|
76
76
|
/**
|
|
@@ -82,16 +82,16 @@ class Launcher {
|
|
|
82
82
|
* run onPrepare hook
|
|
83
83
|
*/
|
|
84
84
|
log.info('Run onPrepare hook');
|
|
85
|
-
await utils_2.runLauncherHook(config.onPrepare, config, caps);
|
|
86
|
-
await utils_2.runServiceHook(this._launcher, 'onPrepare', config, caps);
|
|
85
|
+
await (0, utils_2.runLauncherHook)(config.onPrepare, config, caps);
|
|
86
|
+
await (0, utils_2.runServiceHook)(this._launcher, 'onPrepare', config, caps);
|
|
87
87
|
exitCode = await this.runMode(config, caps);
|
|
88
88
|
/**
|
|
89
89
|
* run onComplete hook
|
|
90
90
|
* even if it fails we still want to see result and end logger stream
|
|
91
91
|
*/
|
|
92
92
|
log.info('Run onComplete hook');
|
|
93
|
-
await utils_2.runServiceHook(this._launcher, 'onComplete', exitCode, config, caps);
|
|
94
|
-
const onCompleteResults = await utils_2.runOnCompleteHook(config.onComplete, config, caps, exitCode, this.interface.result);
|
|
93
|
+
await (0, utils_2.runServiceHook)(this._launcher, 'onComplete', exitCode, config, caps);
|
|
94
|
+
const onCompleteResults = await (0, utils_2.runOnCompleteHook)(config.onComplete, config, caps, exitCode, this.interface.result);
|
|
95
95
|
// if any of the onComplete hooks failed, update the exit code
|
|
96
96
|
exitCode = onCompleteResults.includes(1) ? 1 : exitCode;
|
|
97
97
|
await logger_1.default.waitForBuffer();
|
|
@@ -275,7 +275,7 @@ class Launcher {
|
|
|
275
275
|
let config = this.configParser.getConfig();
|
|
276
276
|
// wait before retrying the spec file
|
|
277
277
|
if (typeof config.specFileRetriesDelay === 'number' && config.specFileRetries > 0 && config.specFileRetries !== retries) {
|
|
278
|
-
await utils_1.sleep(config.specFileRetriesDelay * 1000);
|
|
278
|
+
await (0, utils_1.sleep)(config.specFileRetriesDelay * 1000);
|
|
279
279
|
}
|
|
280
280
|
// Retried tests receive the cid of the failing test as rid
|
|
281
281
|
// so they can run with the same cid of the failing test.
|
|
@@ -309,12 +309,17 @@ class Launcher {
|
|
|
309
309
|
let defaultArgs = (capExecArgs.length) ? process.execArgv : [];
|
|
310
310
|
// If an arg appears multiple times the last occurrence is used
|
|
311
311
|
let execArgv = [...defaultArgs, ...debugArgs, ...capExecArgs];
|
|
312
|
+
// set '--no-wasm-code-gc' deliberatively as it causes problems with
|
|
313
|
+
// @wdio/sync and recent TypeScript compiles
|
|
314
|
+
if (!execArgv.includes('--no-wasm-code-gc')) {
|
|
315
|
+
execArgv.push('--no-wasm-code-gc');
|
|
316
|
+
}
|
|
312
317
|
// bump up worker count
|
|
313
318
|
this._runnerStarted++;
|
|
314
319
|
// run worker hook to allow modify runtime and capabilities of a specific worker
|
|
315
320
|
log.info('Run onWorkerStart hook');
|
|
316
|
-
await utils_2.runLauncherHook(config.onWorkerStart, runnerId, caps, specs, this._args, execArgv);
|
|
317
|
-
await utils_2.runServiceHook(this._launcher, 'onWorkerStart', runnerId, caps, specs, this._args, execArgv);
|
|
321
|
+
await (0, utils_2.runLauncherHook)(config.onWorkerStart, runnerId, caps, specs, this._args, execArgv);
|
|
322
|
+
await (0, utils_2.runServiceHook)(this._launcher, 'onWorkerStart', runnerId, caps, specs, this._args, execArgv);
|
|
318
323
|
// prefer launcher settings in capabilities over general launcher
|
|
319
324
|
const worker = this.runner.run({
|
|
320
325
|
cid: runnerId,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Function to be executed after a test (in Mocha/Jasmine)
|
|
2
|
+
* Function to be executed after a test (in Mocha/Jasmine only)
|
|
3
|
+
* @param {Object} test test object
|
|
4
|
+
* @param {Object} context scope object the test was executed with
|
|
5
|
+
* @param {Error} result.error error object in case the test fails, otherwise `undefined`
|
|
6
|
+
* @param {Any} result.result return object of test function
|
|
7
|
+
* @param {Number} result.duration duration of test
|
|
8
|
+
* @param {Boolean} result.passed true if test has passed, otherwise false
|
|
9
|
+
* @param {Object} result.retries informations to spec related retries, e.g. `{ attempts: 0, limit: 0 }`
|
|
3
10
|
*/<%
|
|
4
11
|
if (reporters.length && reporters.includes('allure')) {%>
|
|
5
12
|
afterTest: async function(test, context, { error, result, duration, passed, retries }) {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
//
|
|
94
94
|
// If you have trouble getting all important capabilities together, check out the
|
|
95
95
|
// Sauce Labs platform configurator - a great tool to configure your capabilities:
|
|
96
|
-
// https://
|
|
96
|
+
// https://saucelabs.com/platform/platform-configurator
|
|
97
97
|
//
|
|
98
98
|
capabilities: [{
|
|
99
99
|
<%if(answers.expEnvAccessKey){%> 'experitest:accessKey': '<%= answers.expEnvAccessKey %>',<%}%>
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQ/G;;GAEG;AACH,wBAAsB,cAAc,CAChC,QAAQ,EAAE,QAAQ,CAAC,eAAe,EAAE,EACpC,QAAQ,EAAE,MAAM,QAAQ,CAAC,aAAa,EACtC,GAAG,IAAI,EAAE,GAAG,EAAE,sBA2BjB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,yBAchF;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACnC,cAAc,EAAE,QAAQ,GAAG,QAAQ,EAAE,EACrC,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,YAAY,EAAE,YAAY,CAAC,kBAAkB,EAC7C,QAAQ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,MAAM,UAAQ,QAmC3F;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAS,GAAG,gBAAgB,CAMvF;AAED,wBAAsB,uBAAuB,CAAE,OAAO,EAAE,aAAa,iBAKpE;AAED,eAAO,MAAM,sBAAsB,YAAa,MAAM,EAAE,KAAG,OAAO,GAAG,MAgBpE,CAAA;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,oBAAoB;;;;;8BAlOzD;;WAEG;;;;;;;;;;8BAFH;;WAEG;;;;;;;;EAwPF;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,WAExC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAE,GAAG,EAAE,MAAM,WActC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAE,OAAO,EAAE,aAAa,iBA6B9D;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CA2BpE;AAED,wBAAgB,wBAAwB,CAAE,OAAO,EAAE,YAAY;;;;;EA+B9D;AAED,wBAAgB,eAAe,CAAE,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,MAAM,UAIhF"}
|
package/build/utils.js
CHANGED
|
@@ -14,9 +14,9 @@ const webdriverio_1 = require("webdriverio");
|
|
|
14
14
|
const child_process_1 = require("child_process");
|
|
15
15
|
const util_1 = require("util");
|
|
16
16
|
const constants_1 = require("./constants");
|
|
17
|
-
const log = logger_1.default('@wdio/cli:utils');
|
|
17
|
+
const log = (0, logger_1.default)('@wdio/cli:utils');
|
|
18
18
|
const TEMPLATE_ROOT_DIR = path_1.default.join(__dirname, 'templates', 'exampleFiles');
|
|
19
|
-
const renderFile = util_1.promisify(ejs_1.default.renderFile);
|
|
19
|
+
const renderFile = (0, util_1.promisify)(ejs_1.default.renderFile);
|
|
20
20
|
/**
|
|
21
21
|
* run service launch sequences
|
|
22
22
|
*/
|
|
@@ -28,9 +28,9 @@ async function runServiceHook(launcher, hookName, ...args) {
|
|
|
28
28
|
await service[hookName](...args);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
catch (
|
|
32
|
-
const message = `A service failed in the '${hookName}' hook\n${
|
|
33
|
-
if (
|
|
31
|
+
catch (err) {
|
|
32
|
+
const message = `A service failed in the '${hookName}' hook\n${err.stack}\n\n`;
|
|
33
|
+
if (err instanceof webdriverio_1.SevereServiceError) {
|
|
34
34
|
return { status: 'rejected', reason: message };
|
|
35
35
|
}
|
|
36
36
|
log.error(`${message}Continue...`);
|
|
@@ -61,8 +61,8 @@ async function runLauncherHook(hook, ...args) {
|
|
|
61
61
|
try {
|
|
62
62
|
return hook(...args);
|
|
63
63
|
}
|
|
64
|
-
catch (
|
|
65
|
-
return catchFn(
|
|
64
|
+
catch (err) {
|
|
65
|
+
return catchFn(err);
|
|
66
66
|
}
|
|
67
67
|
})).catch(catchFn);
|
|
68
68
|
}
|
|
@@ -84,8 +84,8 @@ async function runOnCompleteHook(onCompleteHook, config, capabilities, exitCode,
|
|
|
84
84
|
await hook(exitCode, config, capabilities, results);
|
|
85
85
|
return 0;
|
|
86
86
|
}
|
|
87
|
-
catch (
|
|
88
|
-
log.error(`Error in onCompleteHook: ${
|
|
87
|
+
catch (err) {
|
|
88
|
+
log.error(`Error in onCompleteHook: ${err.stack}`);
|
|
89
89
|
return 1;
|
|
90
90
|
}
|
|
91
91
|
}));
|
|
@@ -99,7 +99,11 @@ function getRunnerName(caps = {}) {
|
|
|
99
99
|
caps.appPackage ||
|
|
100
100
|
caps.appWaitActivity ||
|
|
101
101
|
caps.app ||
|
|
102
|
-
caps.platformName
|
|
102
|
+
caps.platformName ||
|
|
103
|
+
caps['appium:platformName'] ||
|
|
104
|
+
caps['appium:appPackage'] ||
|
|
105
|
+
caps['appium:appWaitActivity'] ||
|
|
106
|
+
caps['appium:app'];
|
|
103
107
|
// MultiRemote
|
|
104
108
|
if (!runner) {
|
|
105
109
|
runner = Object.values(caps).length === 0 || Object.values(caps).some(cap => !cap.capabilities) ? 'undefined' : 'MultiRemote';
|
|
@@ -158,7 +162,7 @@ function addServiceDeps(names, packages, update = false) {
|
|
|
158
162
|
* was selected for install
|
|
159
163
|
*/
|
|
160
164
|
if (names.some(({ short }) => short === 'appium')) {
|
|
161
|
-
const result = child_process_1.execSync('appium --version || echo APPIUM_MISSING').toString().trim();
|
|
165
|
+
const result = (0, child_process_1.execSync)('appium --version || echo APPIUM_MISSING').toString().trim();
|
|
162
166
|
if (result === 'APPIUM_MISSING') {
|
|
163
167
|
packages.push('appium');
|
|
164
168
|
}
|
|
@@ -251,7 +255,7 @@ function hasPackage(pkg) {
|
|
|
251
255
|
require.resolve(pkg);
|
|
252
256
|
return true;
|
|
253
257
|
}
|
|
254
|
-
catch (
|
|
258
|
+
catch (err) {
|
|
255
259
|
return false;
|
|
256
260
|
}
|
|
257
261
|
}
|
|
@@ -268,7 +272,7 @@ async function generateTestFiles(answers) {
|
|
|
268
272
|
if (answers.usePageObjects) {
|
|
269
273
|
testFiles.push(path_1.default.join(TEMPLATE_ROOT_DIR, 'pageobjects'));
|
|
270
274
|
}
|
|
271
|
-
const files = (await Promise.all(testFiles.map((dirPath) => recursive_readdir_1.default(dirPath, [(file, stats) => !stats.isDirectory() && !(file.endsWith('.ejs') || file.endsWith('.feature'))])))).reduce((cur, acc) => [...acc, ...(cur)], []);
|
|
275
|
+
const files = (await Promise.all(testFiles.map((dirPath) => (0, recursive_readdir_1.default)(dirPath, [(file, stats) => !stats.isDirectory() && !(file.endsWith('.ejs') || file.endsWith('.feature'))])))).reduce((cur, acc) => [...acc, ...(cur)], []);
|
|
272
276
|
for (const file of files) {
|
|
273
277
|
const renderedTpl = await renderFile(file, answers);
|
|
274
278
|
let destPath = (file.endsWith('page.js.ejs')
|
package/build/watcher.js
CHANGED
|
@@ -9,7 +9,7 @@ const lodash_pickby_1 = __importDefault(require("lodash.pickby"));
|
|
|
9
9
|
const lodash_flattendeep_1 = __importDefault(require("lodash.flattendeep"));
|
|
10
10
|
const lodash_union_1 = __importDefault(require("lodash.union"));
|
|
11
11
|
const launcher_1 = __importDefault(require("./launcher"));
|
|
12
|
-
const log = logger_1.default('@wdio/cli:watch');
|
|
12
|
+
const log = (0, logger_1.default)('@wdio/cli:watch');
|
|
13
13
|
class Watcher {
|
|
14
14
|
constructor(_configFile, _args) {
|
|
15
15
|
this._configFile = _configFile;
|
|
@@ -17,14 +17,14 @@ class Watcher {
|
|
|
17
17
|
log.info('Starting launcher in watch mode');
|
|
18
18
|
this._launcher = new launcher_1.default(this._configFile, this._args, true);
|
|
19
19
|
const specs = this._launcher.configParser.getSpecs();
|
|
20
|
-
const capSpecs = this._launcher.isMultiremote ? [] : lodash_union_1.default(lodash_flattendeep_1.default(this._launcher.configParser.getCapabilities().map(cap => cap.specs || [])));
|
|
20
|
+
const capSpecs = this._launcher.isMultiremote ? [] : (0, lodash_union_1.default)((0, lodash_flattendeep_1.default)(this._launcher.configParser.getCapabilities().map(cap => cap.specs || [])));
|
|
21
21
|
this._specs = [...specs, ...capSpecs];
|
|
22
22
|
}
|
|
23
23
|
async watch() {
|
|
24
24
|
/**
|
|
25
25
|
* listen on spec changes and rerun specific spec file
|
|
26
26
|
*/
|
|
27
|
-
let flattenedSpecs = lodash_flattendeep_1.default(this._specs);
|
|
27
|
+
let flattenedSpecs = (0, lodash_flattendeep_1.default)(this._specs);
|
|
28
28
|
chokidar_1.default.watch(flattenedSpecs, { ignoreInitial: true })
|
|
29
29
|
.on('add', this.getFileListener())
|
|
30
30
|
.on('change', this.getFileListener());
|
|
@@ -97,13 +97,13 @@ class Watcher {
|
|
|
97
97
|
getWorkers(predicate, includeBusyWorker) {
|
|
98
98
|
let workers = this._launcher.runner.workerPool;
|
|
99
99
|
if (typeof predicate === 'function') {
|
|
100
|
-
workers = lodash_pickby_1.default(workers, predicate);
|
|
100
|
+
workers = (0, lodash_pickby_1.default)(workers, predicate);
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* filter out busy workers, only skip if explicitly desired
|
|
104
104
|
*/
|
|
105
105
|
if (!includeBusyWorker) {
|
|
106
|
-
workers = lodash_pickby_1.default(workers, (worker) => !worker.isBusy);
|
|
106
|
+
workers = (0, lodash_pickby_1.default)(workers, (worker) => !worker.isBusy);
|
|
107
107
|
}
|
|
108
108
|
return workers;
|
|
109
109
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cli",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.16.3",
|
|
4
4
|
"description": "WebdriverIO testrunner command line interface",
|
|
5
5
|
"author": "Christian Bromann <christian@saucelabs.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cli",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"@types/lodash.flattendeep": "^4.4.6",
|
|
36
36
|
"@types/lodash.pickby": "^4.6.6",
|
|
37
37
|
"@types/lodash.union": "^4.6.6",
|
|
38
|
-
"@types/node": "^
|
|
38
|
+
"@types/node": "^16.11.1",
|
|
39
39
|
"@types/recursive-readdir": "^2.2.0",
|
|
40
|
-
"@wdio/config": "7.
|
|
41
|
-
"@wdio/logger": "7.
|
|
42
|
-
"@wdio/types": "7.
|
|
43
|
-
"@wdio/utils": "7.
|
|
40
|
+
"@wdio/config": "7.16.3",
|
|
41
|
+
"@wdio/logger": "7.16.0",
|
|
42
|
+
"@wdio/types": "7.16.3",
|
|
43
|
+
"@wdio/utils": "7.16.3",
|
|
44
44
|
"async-exit-hook": "^2.0.1",
|
|
45
45
|
"chalk": "^4.0.0",
|
|
46
46
|
"chokidar": "^3.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"lodash.union": "^4.6.0",
|
|
54
54
|
"mkdirp": "^1.0.4",
|
|
55
55
|
"recursive-readdir": "^2.2.2",
|
|
56
|
-
"webdriverio": "7.
|
|
56
|
+
"webdriverio": "7.16.3",
|
|
57
57
|
"yargs": "^17.0.0",
|
|
58
58
|
"yarn-install": "^1.0.0"
|
|
59
59
|
},
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
63
|
"types": "./build/index.d.ts",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "23e2af933060e829f03d7518089c377571c654e3"
|
|
65
65
|
}
|