@wdio/cli 7.20.9 → 8.0.0-alpha.213

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.
@@ -1,18 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handler = exports.launch = exports.launchWithStdin = exports.builder = exports.cmdArgs = exports.desc = exports.command = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
- const path_1 = __importDefault(require("path"));
9
- const config_1 = require("./config");
10
- const launcher_1 = __importDefault(require("../launcher"));
11
- const watcher_1 = __importDefault(require("../watcher"));
12
- const constants_1 = require("../constants");
13
- exports.command = 'run <configPath>';
14
- exports.desc = 'Run your WDIO configuration file to initialize your tests. (default)';
15
- exports.cmdArgs = {
1
+ import path from 'node:path';
2
+ import fs from 'fs-extra';
3
+ import Launcher from '../launcher.js';
4
+ import Watcher from '../watcher.js';
5
+ import { missingConfigurationPrompt } from './config.js';
6
+ import { CLI_EPILOGUE } from '../constants.js';
7
+ export const command = 'run <configPath>';
8
+ export const desc = 'Run your WDIO configuration file to initialize your tests. (default)';
9
+ export const cmdArgs = {
16
10
  watch: {
17
11
  desc: 'Run WebdriverIO in watch mode',
18
12
  type: 'boolean',
@@ -94,19 +88,18 @@ exports.cmdArgs = {
94
88
  desc: 'Auto compilation options'
95
89
  }
96
90
  };
97
- const builder = (yargs) => {
91
+ export const builder = (yargs) => {
98
92
  return yargs
99
- .options(exports.cmdArgs)
93
+ .options(cmdArgs)
100
94
  .example('$0 run wdio.conf.js --suite foobar', 'Run suite on testsuite "foobar"')
101
95
  .example('$0 run wdio.conf.js --spec ./tests/e2e/a.js --spec ./tests/e2e/b.js', 'Run suite on specific specs')
102
96
  .example('$0 run wdio.conf.js --mochaOpts.timeout 60000', 'Run suite with custom Mocha timeout')
103
97
  .example('$0 run wdio.conf.js --autoCompileOpts.autoCompile=false', 'Disable auto-loading of ts-node or @babel/register')
104
98
  .example('$0 run wdio.conf.js --autoCompileOpts.tsNodeOpts.project=configs/bdd-tsconfig.json', 'Run suite with ts-node using custom tsconfig.json')
105
- .epilogue(constants_1.CLI_EPILOGUE)
99
+ .epilogue(CLI_EPILOGUE)
106
100
  .help();
107
101
  };
108
- exports.builder = builder;
109
- function launchWithStdin(wdioConfPath, params) {
102
+ export function launchWithStdin(wdioConfPath, params) {
110
103
  let stdinData = '';
111
104
  const stdin = process.openStdin();
112
105
  stdin.setEncoding('utf8');
@@ -120,37 +113,36 @@ function launchWithStdin(wdioConfPath, params) {
120
113
  launch(wdioConfPath, params);
121
114
  });
122
115
  }
123
- exports.launchWithStdin = launchWithStdin;
124
- function launch(wdioConfPath, params) {
125
- const launcher = new launcher_1.default(wdioConfPath, params);
116
+ export function launch(wdioConfPath, params) {
117
+ const launcher = new Launcher(wdioConfPath, params);
126
118
  return launcher.run()
127
119
  .then((...args) => {
128
120
  /* istanbul ignore if */
129
- if (!process.env.JEST_WORKER_ID) {
121
+ if (!process.env.VITEST_WORKER_ID) {
130
122
  process.exit(...args);
131
123
  }
132
124
  })
133
125
  .catch(err => {
134
126
  console.error(err);
135
127
  /* istanbul ignore if */
136
- if (!process.env.JEST_WORKER_ID) {
128
+ if (!process.env.VITEST_WORKER_ID) {
137
129
  process.exit(1);
138
130
  }
139
131
  });
140
132
  }
141
- exports.launch = launch;
142
- async function handler(argv) {
133
+ export async function handler(argv) {
143
134
  const { configPath, ...params } = argv;
144
- if (!fs_extra_1.default.existsSync(configPath)) {
145
- await (0, config_1.missingConfigurationPrompt)('run', `No WebdriverIO configuration found in "${process.cwd()}"`);
135
+ if (!fs.existsSync(configPath)) {
136
+ const configFullPath = path.join(process.cwd(), configPath);
137
+ await missingConfigurationPrompt('run', configFullPath);
146
138
  }
147
- const localConf = path_1.default.join(process.cwd(), 'wdio.conf.js');
148
- const wdioConf = configPath || (fs_extra_1.default.existsSync(localConf) ? localConf : undefined);
139
+ const localConf = path.join(process.cwd(), 'wdio.conf.js');
140
+ const wdioConf = configPath || (fs.existsSync(localConf) ? localConf : undefined);
149
141
  /**
150
142
  * if `--watch` param is set, run launcher in watch mode
151
143
  */
152
144
  if (params.watch) {
153
- const watcher = new watcher_1.default(wdioConf, params);
145
+ const watcher = new Watcher(wdioConf, params);
154
146
  return watcher.watch();
155
147
  }
156
148
  /**
@@ -169,4 +161,3 @@ async function handler(argv) {
169
161
  */
170
162
  launchWithStdin(wdioConf, params);
171
163
  }
172
- exports.handler = handler;
@@ -1,4 +1,5 @@
1
- import { Questionnair } from './types';
1
+ import type { Questionnair } from './types';
2
+ export declare const pkg: any;
2
3
  export declare const CLI_EPILOGUE: string;
3
4
  export declare const EXCLUSIVE_SERVICES: {
4
5
  'wdio-chromedriver-service': {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAItC,eAAO,MAAM,YAAY,QAAqE,CAAA;AAE9F,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAA;AAED,eAAO,MAAM,mBAAmB,wFAI/B,CAAA;AAED,eAAO,MAAM,6BAA6B,iHAIzC,CAAA;AAED,eAAO,MAAM,iCAAiC,8CAG7C,CAAA;AAED,eAAO,MAAM,WAAW,KAAK,CAAA;AAE7B,eAAO,MAAM,cAAc;;;;CAI1B,CAAA;AAED,eAAO,MAAM,UAAU;;;;CAItB,CAAA;AAED,eAAO,MAAM,uBAAuB,iGAI1B,CAAA;AAEV,eAAO,MAAM,gBAAgB;;;;CAInB,CAAA;AAEV,eAAO,MAAM,wBAAwB,gQAQpC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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S = exports.BACKEND_CHOICES = exports.SUPPORTED_PACKAGES = exports.TS_COMPILER_INSTRUCTIONS = exports.COMPILER_OPTIONS = exports.COMPILER_OPTION_ANSWERS = exports.IOS_CONFIG = exports.ANDROID_CONFIG = exports.NPM_INSTALL = exports.DEPENDENCIES_INSTALLATION_MESSAGE = exports.CONFIG_HELPER_SUCCESS_MESSAGE = exports.CONFIG_HELPER_INTRO = exports.EXCLUSIVE_SERVICES = exports.CLI_EPILOGUE = void 0;
4
- const utils_1 = require("./utils");
5
- const pkg = require('../package.json');
6
- exports.CLI_EPILOGUE = `Documentation: https://webdriver.io\n@wdio/cli (v${pkg.version})`;
7
- exports.EXCLUSIVE_SERVICES = {
1
+ import { createRequire } from 'node:module';
2
+ import { validateServiceAnswers, hasFile, getDefaultFiles } from './utils.js';
3
+ const require = createRequire(import.meta.url);
4
+ export const pkg = require('../package.json');
5
+ export const CLI_EPILOGUE = `Documentation: https://webdriver.io\n@wdio/cli (v${pkg.version})`;
6
+ export const EXCLUSIVE_SERVICES = {
8
7
  'wdio-chromedriver-service': {
9
8
  services: ['@wdio/selenium-standalone-service'],
10
9
  message: '@wdio/selenium-standalone-service already includes chromedriver'
11
10
  }
12
11
  };
13
- exports.CONFIG_HELPER_INTRO = `
12
+ export const CONFIG_HELPER_INTRO = `
14
13
  =========================
15
14
  WDIO Configuration Helper
16
15
  =========================
17
16
  `;
18
- exports.CONFIG_HELPER_SUCCESS_MESSAGE = `
17
+ export const CONFIG_HELPER_SUCCESS_MESSAGE = `
19
18
  Configuration file was created successfully!
20
19
  To run your tests, execute:
21
20
  $ npx wdio run %swdio.conf.%s
22
21
  `;
23
- exports.DEPENDENCIES_INSTALLATION_MESSAGE = `
22
+ export const DEPENDENCIES_INSTALLATION_MESSAGE = `
24
23
  To install dependencies, execute:
25
24
  %s
26
25
  `;
27
- exports.NPM_INSTALL = '';
28
- exports.ANDROID_CONFIG = {
26
+ export const NPM_INSTALL = '';
27
+ export const ANDROID_CONFIG = {
29
28
  platformName: 'Android',
30
29
  automationName: 'UiAutomator2',
31
30
  deviceName: 'Test'
32
31
  };
33
- exports.IOS_CONFIG = {
32
+ export const IOS_CONFIG = {
34
33
  platformName: 'iOS',
35
34
  automationName: 'XCUITest',
36
35
  deviceName: 'iPhone Simulator'
37
36
  };
38
- exports.COMPILER_OPTION_ANSWERS = [
37
+ export const COMPILER_OPTION_ANSWERS = [
39
38
  'Babel (https://babeljs.io/)',
40
39
  'TypeScript (https://www.typescriptlang.org/)',
41
40
  'No!'
42
41
  ];
43
- exports.COMPILER_OPTIONS = {
44
- babel: exports.COMPILER_OPTION_ANSWERS[0],
45
- ts: exports.COMPILER_OPTION_ANSWERS[1],
46
- nil: exports.COMPILER_OPTION_ANSWERS[2]
42
+ export const COMPILER_OPTIONS = {
43
+ babel: COMPILER_OPTION_ANSWERS[0],
44
+ ts: COMPILER_OPTION_ANSWERS[1],
45
+ nil: COMPILER_OPTION_ANSWERS[2]
47
46
  };
48
- exports.TS_COMPILER_INSTRUCTIONS = `To have TypeScript support please add the following packages to your "types" list:
47
+ export const TS_COMPILER_INSTRUCTIONS = `To have TypeScript support please add the following packages to your "types" list:
49
48
  {
50
49
  "compilerOptions": {
51
50
  "types": ["node", %s]
@@ -58,7 +57,7 @@ For for information on TypeScript integration check out: https://webdriver.io/do
58
57
  * We have to use a string hash for value because InquirerJS default values do not work if we have
59
58
  * objects as a `value` to be stored from the user's answers.
60
59
  */
61
- exports.SUPPORTED_PACKAGES = {
60
+ export const SUPPORTED_PACKAGES = {
62
61
  runner: [
63
62
  { name: 'local', value: '@wdio/local-runner$--$local' }
64
63
  ],
@@ -135,34 +134,34 @@ exports.SUPPORTED_PACKAGES = {
135
134
  { name: 'azure-devops', value: '@gmangiapelo/wdio-azure-devops-service$--$azure-devops' }
136
135
  ]
137
136
  };
138
- exports.BACKEND_CHOICES = [
137
+ export const BACKEND_CHOICES = [
139
138
  'On my local machine',
140
139
  'In the cloud using Experitest',
141
140
  'In the cloud using Sauce Labs',
142
141
  'In the cloud using Browserstack or Testingbot or LambdaTest or a different service',
143
142
  'I have my own Selenium cloud'
144
143
  ];
145
- exports.PROTOCOL_OPTIONS = [
144
+ export const PROTOCOL_OPTIONS = [
146
145
  'https',
147
146
  'http'
148
147
  ];
149
- exports.REGION_OPTION = [
148
+ export const REGION_OPTION = [
150
149
  'us',
151
150
  'eu',
152
151
  'apac'
153
152
  ];
154
- exports.QUESTIONNAIRE = [{
153
+ export const QUESTIONNAIRE = [{
155
154
  type: 'list',
156
155
  name: 'runner',
157
156
  message: 'Where should your tests be launched?',
158
- choices: exports.SUPPORTED_PACKAGES.runner,
157
+ choices: SUPPORTED_PACKAGES.runner,
159
158
  // only ask if there are more than 1 runner to pick from
160
- when: /* istanbul ignore next */ () => exports.SUPPORTED_PACKAGES.runner.length > 1
159
+ when: /* istanbul ignore next */ () => SUPPORTED_PACKAGES.runner.length > 1
161
160
  }, {
162
161
  type: 'list',
163
162
  name: 'backend',
164
163
  message: 'Where is your automation backend located?',
165
- choices: exports.BACKEND_CHOICES
164
+ choices: BACKEND_CHOICES
166
165
  }, {
167
166
  type: 'input',
168
167
  name: 'hostname',
@@ -197,7 +196,7 @@ exports.QUESTIONNAIRE = [{
197
196
  name: 'expEnvProtocol',
198
197
  message: 'Choose a protocol for environment variable',
199
198
  default: 'https',
200
- choices: exports.PROTOCOL_OPTIONS,
199
+ choices: PROTOCOL_OPTIONS,
201
200
  when: /* istanbul ignore next */ (answers) => {
202
201
  return answers.backend === 'In the cloud using Experitest' && answers.expEnvPort !== '80' && answers.expEnvPort !== '443';
203
202
  }
@@ -249,7 +248,7 @@ exports.QUESTIONNAIRE = [{
249
248
  type: 'list',
250
249
  name: 'region',
251
250
  message: 'In which region do you want to run your Sauce Labs tests in?',
252
- choices: exports.REGION_OPTION,
251
+ choices: REGION_OPTION,
253
252
  when: /* istanbul ignore next */ (answers) => !answers.headless && answers.backend === 'In the cloud using Sauce Labs'
254
253
  }, {
255
254
  type: 'input',
@@ -273,22 +272,22 @@ exports.QUESTIONNAIRE = [{
273
272
  type: 'list',
274
273
  name: 'framework',
275
274
  message: 'Which framework do you want to use?',
276
- choices: exports.SUPPORTED_PACKAGES.framework,
275
+ choices: SUPPORTED_PACKAGES.framework,
277
276
  }, {
278
277
  type: 'list',
279
278
  name: 'isUsingCompiler',
280
279
  message: 'Do you want to use a compiler?',
281
- choices: exports.COMPILER_OPTION_ANSWERS,
282
- default: /* istanbul ignore next */ () => (0, utils_1.hasFile)('babel.config.js')
283
- ? exports.COMPILER_OPTIONS.babel // default to Babel
284
- : (0, utils_1.hasFile)('tsconfig.json')
285
- ? exports.COMPILER_OPTIONS.ts // default to TypeScript
286
- : exports.COMPILER_OPTIONS.nil // default to no compiler
280
+ choices: COMPILER_OPTION_ANSWERS,
281
+ default: /* istanbul ignore next */ () => hasFile('babel.config.js')
282
+ ? COMPILER_OPTIONS.babel // default to Babel
283
+ : hasFile('tsconfig.json')
284
+ ? COMPILER_OPTIONS.ts // default to TypeScript
285
+ : COMPILER_OPTIONS.nil // default to no compiler
287
286
  }, {
288
287
  type: 'input',
289
288
  name: 'specs',
290
289
  message: 'Where are your test specs located?',
291
- default: (answers) => (0, utils_1.getDefaultFiles)(answers, './test/specs/**/*'),
290
+ default: (answers) => getDefaultFiles(answers, './test/specs/**/*'),
292
291
  when: /* istanbul ignore next */ (answers) => answers.framework.match(/(mocha|jasmine)/)
293
292
  }, {
294
293
  type: 'input',
@@ -300,7 +299,7 @@ exports.QUESTIONNAIRE = [{
300
299
  type: 'input',
301
300
  name: 'stepDefinitions',
302
301
  message: 'Where are your step definitions located?',
303
- default: (answers) => (0, utils_1.getDefaultFiles)(answers, './features/step-definitions/steps'),
302
+ default: (answers) => getDefaultFiles(answers, './features/step-definitions/steps'),
304
303
  when: /* istanbul ignore next */ (answers) => answers.framework.includes('cucumber')
305
304
  }, {
306
305
  type: 'confirm',
@@ -318,16 +317,16 @@ exports.QUESTIONNAIRE = [{
318
317
  name: 'pages',
319
318
  message: 'Where are your page objects located?',
320
319
  default: /* istanbul ignore next */ (answers) => (answers.framework.match(/(mocha|jasmine)/)
321
- ? (0, utils_1.getDefaultFiles)(answers, './test/pageobjects/**/*')
322
- : (0, utils_1.getDefaultFiles)(answers, './features/pageobjects/**/*')),
320
+ ? getDefaultFiles(answers, './test/pageobjects/**/*')
321
+ : getDefaultFiles(answers, './features/pageobjects/**/*')),
323
322
  when: /* istanbul ignore next */ (answers) => answers.generateTestFiles && answers.usePageObjects
324
323
  }, {
325
324
  type: 'checkbox',
326
325
  name: 'reporters',
327
326
  message: 'Which reporter do you want to use?',
328
- choices: exports.SUPPORTED_PACKAGES.reporter,
327
+ choices: SUPPORTED_PACKAGES.reporter,
329
328
  // @ts-ignore
330
- default: [exports.SUPPORTED_PACKAGES.reporter.find(
329
+ default: [SUPPORTED_PACKAGES.reporter.find(
331
330
  /* istanbul ignore next */
332
331
  ({ name }) => name === 'spec').value
333
332
  ]
@@ -335,19 +334,19 @@ exports.QUESTIONNAIRE = [{
335
334
  type: 'checkbox',
336
335
  name: 'plugins',
337
336
  message: 'Do you want to add a plugin to your test setup?',
338
- choices: exports.SUPPORTED_PACKAGES.plugin,
337
+ choices: SUPPORTED_PACKAGES.plugin,
339
338
  default: []
340
339
  }, {
341
340
  type: 'checkbox',
342
341
  name: 'services',
343
342
  message: 'Do you want to add a service to your test setup?',
344
- choices: exports.SUPPORTED_PACKAGES.service,
343
+ choices: SUPPORTED_PACKAGES.service,
345
344
  // @ts-ignore
346
- default: [exports.SUPPORTED_PACKAGES.service.find(
345
+ default: [SUPPORTED_PACKAGES.service.find(
347
346
  /* istanbul ignore next */
348
347
  ({ name }) => name === 'chromedriver').value
349
348
  ],
350
- validate: /* istanbul ignore next */ (answers) => (0, utils_1.validateServiceAnswers)(answers)
349
+ validate: /* istanbul ignore next */ (answers) => validateServiceAnswers(answers)
351
350
  }, {
352
351
  type: 'input',
353
352
  name: 'outputDir',
package/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import Launcher from './launcher';
1
+ import Launcher from './launcher.js';
2
2
  export declare const run: () => Promise<void>;
3
3
  export default Launcher;
4
- export * from './types';
4
+ export * from './types.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,QAAQ,MAAM,YAAY,CAAA;AAkBjC,eAAO,MAAM,GAAG,qBAyDf,CAAA;AAED,eAAe,QAAQ,CAAA;AACvB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,QAAQ,MAAM,eAAe,CAAA;AAqBpC,eAAO,MAAM,GAAG,qBA0Df,CAAA;AAED,eAAe,QAAQ,CAAA;AACvB,cAAc,YAAY,CAAA"}
package/build/index.js CHANGED
@@ -1,30 +1,13 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.run = void 0;
21
- const fs_1 = __importDefault(require("fs"));
22
- const path_1 = __importDefault(require("path"));
23
- const yargs_1 = __importDefault(require("yargs/yargs"));
24
- const helpers_1 = require("yargs/helpers");
25
- const launcher_1 = __importDefault(require("./launcher"));
26
- const run_1 = require("./commands/run");
27
- const constants_1 = require("./constants");
1
+ import fs from 'node:fs';
2
+ import url from 'node:url';
3
+ import path from 'node:path';
4
+ import yargs from 'yargs';
5
+ import { hideBin } from 'yargs/helpers';
6
+ import Launcher from './launcher.js';
7
+ import { commands } from './commands/index.js';
8
+ import { handler, cmdArgs } from './commands/run.js';
9
+ import { CLI_EPILOGUE } from './constants.js';
10
+ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
28
11
  const DEFAULT_CONFIG_FILENAME = 'wdio.conf.js';
29
12
  const DESCRIPTION = [
30
13
  'The `wdio` command allows you run and manage your WebdriverIO test suite.',
@@ -37,9 +20,10 @@ const DESCRIPTION = [
37
20
  '',
38
21
  'For more information, visit: https://webdriver.io/docs/clioptions'
39
22
  ];
40
- const run = async () => {
41
- const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
42
- .commandDir('commands')
23
+ export const run = async () => {
24
+ const commandDir = path.join(__dirname, 'commands');
25
+ const argv = yargs(hideBin(process.argv))
26
+ .command(commands)
43
27
  .example('wdio run wdio.conf.js --suite foobar', 'Run suite on testsuite "foobar"')
44
28
  .example('wdio run wdio.conf.js --spec ./tests/e2e/a.js --spec ./tests/e2e/b.js', 'Run suite on specific specs')
45
29
  .example('wdio run wdio.conf.js --spec ./tests/e2e/a.feature:5', 'Run scenario by line number')
@@ -48,14 +32,14 @@ const run = async () => {
48
32
  .example('wdio install reporter spec', 'Install @wdio/spec-reporter')
49
33
  .example('wdio repl chrome -u <SAUCE_USERNAME> -k <SAUCE_ACCESS_KEY>', 'Run repl in Sauce Labs cloud')
50
34
  .updateStrings({ 'Commands:': `${DESCRIPTION.join('\n')}\n\nCommands:` })
51
- .epilogue(constants_1.CLI_EPILOGUE);
35
+ .epilogue(CLI_EPILOGUE);
52
36
  /**
53
37
  * parse CLI arguments according to what run expects, without this adding
54
38
  * `--spec ./test.js` results in propagating the spec parameter as a
55
39
  * string while in reality is should be parsed into a array of strings
56
40
  */
57
41
  if (!process.argv.find((arg) => arg === '--help')) {
58
- argv.options(run_1.cmdArgs);
42
+ argv.options(cmdArgs);
59
43
  }
60
44
  /**
61
45
  * The only way we reach this point is if the user runs the binary without a command (i.e. wdio wdio.conf.js)
@@ -66,24 +50,23 @@ const run = async () => {
66
50
  * we don't have to check that again here.
67
51
  */
68
52
  const params = await argv.parse();
69
- const supportedCommands = fs_1.default
70
- .readdirSync(path_1.default.join(__dirname, 'commands'))
53
+ const supportedCommands = fs
54
+ .readdirSync(commandDir)
71
55
  .map((file) => file.slice(0, -3));
72
56
  if (params._ && !params._.find((param) => supportedCommands.includes(param))) {
73
57
  const args = {
74
58
  ...params,
75
- configPath: path_1.default.resolve(process.cwd(), params._[0] && params._[0].toString() || DEFAULT_CONFIG_FILENAME)
59
+ configPath: path.resolve(process.cwd(), params._[0] && params._[0].toString() || DEFAULT_CONFIG_FILENAME)
76
60
  };
77
- return (0, run_1.handler)(args).catch(async (err) => {
78
- const output = await new Promise((resolve) => ((0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)).parse('--help', (err, argv, output) => resolve(output))));
61
+ return handler(args).catch(async (err) => {
62
+ const output = await new Promise((resolve) => (yargs(hideBin(process.argv)).parse('--help', (err, argv, output) => resolve(output))));
79
63
  console.error(`${output}\n\n${err.stack}`);
80
64
  /* istanbul ignore if */
81
- if (!process.env.JEST_WORKER_ID) {
65
+ if (!process.env.VITEST_WORKER_ID) {
82
66
  process.exit(1);
83
67
  }
84
68
  });
85
69
  }
86
70
  };
87
- exports.run = run;
88
- exports.default = launcher_1.default;
89
- __exportStar(require("./types"), exports);
71
+ export default Launcher;
72
+ export * from './types.js';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
- import { EventEmitter } from 'events';
2
+ import { EventEmitter } from 'node:events';
3
3
  import type { Options, Workers } from '@wdio/types';
4
- import { HookError } from './utils';
4
+ import { HookError } from './utils.js';
5
5
  interface TestError {
6
6
  type: string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,SAAI;IAIvD,aAAa,CAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,SAAI;IAI1D,UAAU,CAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG;IAI1C,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,SAAI,EAAE,OAAO,SAAK,EAAE,OAAO,GAAE,QAAmB;IAYrG,WAAW,CAAE,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,YAAY,CAAE,KAAK,EAAE,SAAS;IAI9B;;OAEG;IACH,SAAS,CAAE,KAAK,EAAE,iBAAiB;IA8CnC,aAAa;IAgBb,cAAc;IAYd,YAAY;IAaZ,QAAQ;CAQX"}
@@ -1,14 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const chalk_1 = __importDefault(require("chalk"));
7
- const events_1 = require("events");
8
- const logger_1 = __importDefault(require("@wdio/logger"));
9
- const utils_1 = require("./utils");
10
- const log = (0, logger_1.default)('@wdio/cli');
11
- class WDIOCLInterface extends events_1.EventEmitter {
1
+ import { EventEmitter } from 'node:events';
2
+ import chalk, { supportsColor } from 'chalk';
3
+ import logger from '@wdio/logger';
4
+ import { getRunnerName } from './utils.js';
5
+ const log = logger('@wdio/cli');
6
+ export default class WDIOCLInterface extends EventEmitter {
12
7
  constructor(_config, totalWorkerCnt, _isWatchMode = false) {
13
8
  super();
14
9
  this._config = _config;
@@ -33,7 +28,7 @@ class WDIOCLInterface extends events_1.EventEmitter {
33
28
  * `FORCE_COLOR=1` - forcibly enable colors
34
29
  * `FORCE_COLOR=0` - forcibly disable colors
35
30
  */
36
- this.hasAnsiSupport = chalk_1.default.supportsColor.hasBasic;
31
+ this.hasAnsiSupport = supportsColor && supportsColor.hasBasic;
37
32
  this.totalWorkerCnt = totalWorkerCnt;
38
33
  this._isWatchMode = _isWatchMode;
39
34
  this._specFileRetries = _config.specFileRetries || 0;
@@ -62,27 +57,27 @@ class WDIOCLInterface extends events_1.EventEmitter {
62
57
  };
63
58
  }
64
59
  onStart() {
65
- this.log(chalk_1.default.bold(`\nExecution of ${chalk_1.default.blue(this.totalWorkerCnt)} workers started at`), this._start.toISOString());
60
+ this.log(chalk.bold(`\nExecution of ${chalk.blue(this.totalWorkerCnt)} workers started at`), this._start.toISOString());
66
61
  if (this._inDebugMode) {
67
- this.log(chalk_1.default.bgYellow.black('DEBUG mode enabled!'));
62
+ this.log(chalk.bgYellow.black('DEBUG mode enabled!'));
68
63
  }
69
64
  if (this._isWatchMode) {
70
- this.log(chalk_1.default.bgYellow.black('WATCH mode enabled!'));
65
+ this.log(chalk.bgYellow.black('WATCH mode enabled!'));
71
66
  }
72
67
  this.log('');
73
68
  }
74
69
  onSpecRunning(rid) {
75
- this.onJobComplete(rid, this._jobs.get(rid), 0, chalk_1.default.bold.cyan('RUNNING'));
70
+ this.onJobComplete(rid, this._jobs.get(rid), 0, chalk.bold.cyan('RUNNING'));
76
71
  }
77
72
  onSpecRetry(rid, job, retries = 0) {
78
73
  const delayMsg = this._specFileRetriesDelay > 0 ? ` after ${this._specFileRetriesDelay}s` : '';
79
- this.onJobComplete(rid, job, retries, chalk_1.default.bold(chalk_1.default.yellow('RETRYING') + delayMsg));
74
+ this.onJobComplete(rid, job, retries, chalk.bold(chalk.yellow('RETRYING') + delayMsg));
80
75
  }
81
76
  onSpecPass(rid, job, retries = 0) {
82
- this.onJobComplete(rid, job, retries, chalk_1.default.bold.green('PASSED'));
77
+ this.onJobComplete(rid, job, retries, chalk.bold.green('PASSED'));
83
78
  }
84
79
  onSpecFailure(rid, job, retries = 0) {
85
- this.onJobComplete(rid, job, retries, chalk_1.default.bold.red('FAILED'));
80
+ this.onJobComplete(rid, job, retries, chalk.bold.red('FAILED'));
86
81
  }
87
82
  onSpecSkip(rid, job) {
88
83
  this.onJobComplete(rid, job, 0, 'SKIPPED', log.info);
@@ -90,7 +85,7 @@ class WDIOCLInterface extends events_1.EventEmitter {
90
85
  onJobComplete(cid, job, retries = 0, message = '', _logger = this.log) {
91
86
  const details = [`[${cid}]`, message];
92
87
  if (job) {
93
- details.push('in', (0, utils_1.getRunnerName)(job.caps), this.getFilenames(job.specs));
88
+ details.push('in', getRunnerName(job.caps), this.getFilenames(job.specs));
94
89
  }
95
90
  if (retries > 0) {
96
91
  details.push(`(${retries} retries)`);
@@ -98,13 +93,12 @@ class WDIOCLInterface extends events_1.EventEmitter {
98
93
  return _logger(...details);
99
94
  }
100
95
  onTestError(payload) {
101
- var _a, _b, _c;
102
96
  const error = {
103
- type: ((_a = payload.error) === null || _a === void 0 ? void 0 : _a.type) || 'Error',
104
- message: ((_b = payload.error) === null || _b === void 0 ? void 0 : _b.message) || (typeof payload.error === 'string' ? payload.error : 'Unknown error.'),
105
- stack: (_c = payload.error) === null || _c === void 0 ? void 0 : _c.stack
97
+ type: payload.error?.type || 'Error',
98
+ message: payload.error?.message || (typeof payload.error === 'string' ? payload.error : 'Unknown error.'),
99
+ stack: payload.error?.stack
106
100
  };
107
- return this.log(`[${payload.cid}]`, `${chalk_1.default.red(error.type)} in "${payload.fullTitle}"\n${chalk_1.default.red(error.stack || error.message)}`);
101
+ return this.log(`[${payload.cid}]`, `${chalk.red(error.type)} in "${payload.fullTitle}"\n${chalk.red(error.stack || error.message)}`);
108
102
  }
109
103
  getFilenames(specs = []) {
110
104
  if (specs.length > 0) {
@@ -161,7 +155,7 @@ class WDIOCLInterface extends events_1.EventEmitter {
161
155
  return args;
162
156
  }
163
157
  logHookError(error) {
164
- return this.log(`${chalk_1.default.red(error.name)} in "${error.origin}"\n${chalk_1.default.red(error.stack || error.message)}`);
158
+ return this.log(`${chalk.red(error.name)} in "${error.origin}"\n${chalk.red(error.stack || error.message)}`);
165
159
  }
166
160
  /**
167
161
  * event handler that is triggered when runner sends up events
@@ -172,7 +166,7 @@ class WDIOCLInterface extends events_1.EventEmitter {
172
166
  return;
173
167
  }
174
168
  if (event.origin === 'debugger' && event.name === 'start') {
175
- this.log(chalk_1.default.yellow(event.params.introMessage));
169
+ this.log(chalk.yellow(event.params.introMessage));
176
170
  this._inDebugMode = true;
177
171
  return this._inDebugMode;
178
172
  }
@@ -187,7 +181,7 @@ class WDIOCLInterface extends events_1.EventEmitter {
187
181
  return log.warn(`Can't identify message from worker: ${JSON.stringify(event)}, ignoring!`);
188
182
  }
189
183
  if (event.origin === 'worker' && event.name === 'error') {
190
- return this.log(`[${event.cid}]`, chalk_1.default.white.bgRed.bold(' Error: '), event.content.message || event.content.stack || event.content);
184
+ return this.log(`[${event.cid}]`, chalk.white.bgRed.bold(' Error: '), event.content.message || event.content.stack || event.content);
191
185
  }
192
186
  if (event.origin !== 'reporter' && event.origin !== 'debugger') {
193
187
  return this.log(event.cid, event.origin, event.name, event.content);
@@ -224,18 +218,18 @@ class WDIOCLInterface extends events_1.EventEmitter {
224
218
  const reporter = this._messages.reporter;
225
219
  this._messages.reporter = {};
226
220
  for (const [reporterName, messages] of Object.entries(reporter)) {
227
- this.log('\n', chalk_1.default.bold.magenta(`"${reporterName}" Reporter:`));
221
+ this.log('\n', chalk.bold.magenta(`"${reporterName}" Reporter:`));
228
222
  this.log(messages.join(''));
229
223
  }
230
224
  }
231
225
  printSummary() {
232
226
  const totalJobs = this.totalWorkerCnt - this.result.retries;
233
227
  const elapsed = (new Date(Date.now() - this._start.getTime())).toUTCString().match(/(\d\d:\d\d:\d\d)/)[0];
234
- const retries = this.result.retries ? chalk_1.default.yellow(this.result.retries, 'retries') + ', ' : '';
235
- const failed = this.result.failed ? chalk_1.default.red(this.result.failed, 'failed') + ', ' : '';
236
- const skipped = this._skippedSpecs > 0 ? chalk_1.default.gray(this._skippedSpecs, 'skipped') + ', ' : '';
228
+ const retries = this.result.retries ? chalk.yellow(this.result.retries, 'retries') + ', ' : '';
229
+ const failed = this.result.failed ? chalk.red(this.result.failed, 'failed') + ', ' : '';
230
+ const skipped = this._skippedSpecs > 0 ? chalk.gray(this._skippedSpecs, 'skipped') + ', ' : '';
237
231
  const percentCompleted = totalJobs ? Math.round(this.result.finished / totalJobs * 100) : 0;
238
- return this.log('\nSpec Files:\t', chalk_1.default.green(this.result.passed, 'passed') + ', ' + retries + failed + skipped + totalJobs, 'total', `(${percentCompleted}% completed)`, 'in', elapsed, '\n');
232
+ return this.log('\nSpec Files:\t', chalk.green(this.result.passed, 'passed') + ', ' + retries + failed + skipped + totalJobs, 'total', `(${percentCompleted}% completed)`, 'in', elapsed, '\n');
239
233
  }
240
234
  finalise() {
241
235
  if (this._isWatchMode) {
@@ -245,4 +239,3 @@ class WDIOCLInterface extends events_1.EventEmitter {
245
239
  this.printSummary();
246
240
  }
247
241
  }
248
- exports.default = WDIOCLInterface;