@wdio/cli 8.11.4 → 8.12.0

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.
Files changed (29) hide show
  1. package/build/cjs/index.js +2 -2
  2. package/build/commands/config.d.ts.map +1 -1
  3. package/build/commands/config.js +1 -0
  4. package/build/commands/run.js +1 -1
  5. package/build/constants.d.ts +119 -56
  6. package/build/constants.d.ts.map +1 -1
  7. package/build/constants.js +110 -42
  8. package/build/templates/exampleFiles/cucumber/step_definitions/steps.js.ejs +6 -6
  9. package/build/templates/exampleFiles/mochaJasmine/test.e2e.js.ejs +11 -0
  10. package/build/templates/exampleFiles/pageobjects/login.page.js.ejs +9 -9
  11. package/build/templates/exampleFiles/pageobjects/page.js.ejs +2 -2
  12. package/build/templates/exampleFiles/pageobjects/secure.page.js.ejs +5 -5
  13. package/build/templates/snippets/capabilities.ejs +46 -0
  14. package/build/templates/snippets/electronTest.js.ejs +9 -0
  15. package/build/templates/snippets/macosTest.js.ejs +11 -0
  16. package/build/templates/snippets/services.ejs +18 -0
  17. package/build/templates/snippets/testWithPO.js.ejs +20 -0
  18. package/build/templates/snippets/testWithoutPO.js.ejs +16 -0
  19. package/build/templates/snippets/vscodeTest.js.ejs +9 -0
  20. package/build/templates/wdio.conf.tpl.ejs +23 -29
  21. package/build/types.d.ts +7 -2
  22. package/build/types.d.ts.map +1 -1
  23. package/build/utils.d.ts.map +1 -1
  24. package/build/utils.js +18 -11
  25. package/package.json +2 -2
  26. package/build/templates/exampleFiles/jasmine/example.e2e.js.ejs +0 -42
  27. package/build/templates/exampleFiles/mocha/example.e2e.js.ejs +0 -42
  28. /package/build/templates/{afterTest.ejs → snippets/afterTest.ejs} +0 -0
  29. /package/build/templates/{reporters.ejs → snippets/reporters.ejs} +0 -0
@@ -7,14 +7,14 @@ class Launcher {
7
7
  this.configFilePath = configFilePath;
8
8
  this.args = args;
9
9
  this.isWatchMode = isWatchMode;
10
- import('../launcher.js').then(launcher => this.#esmLauncher = new launcher.default(this.configFilePath, this.args, this.isWatchMode));
10
+ this.#esmLauncher = import('../launcher.js').then(({ default: Launcher }) => new Launcher(this.configFilePath, this.args, this.isWatchMode));
11
11
  }
12
12
  /**
13
13
  * run sequence
14
14
  * @return {Promise} that only gets resolved with either an exitCode or an error
15
15
  */
16
16
  async run() {
17
- return this.#esmLauncher.run();
17
+ return (await this.#esmLauncher).run();
18
18
  }
19
19
  }
20
20
  async function run() {
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIxE,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,IAAI,4EAA4E,CAAA;AAE7F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBV,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;GAKlC,CAAA;AAED,eAAO,MAAM,YAAY,QAAwB,OAAO,KAAG,QAAQ,aAAa,CAkF/E,CAAA;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAoBpG;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,sBAAsB,EAAE,YAAY,0BAAmB;;;;GAQ1F;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;GAMzD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,oBAc3D;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,UAAQ,EAAE,YAAY,0BAAmB,8BA4BrI"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIxE,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,IAAI,4EAA4E,CAAA;AAE7F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBV,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;GAKlC,CAAA;AAED,eAAO,MAAM,YAAY,QAAwB,OAAO,KAAG,QAAQ,aAAa,CAmF/E,CAAA;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAoBpG;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,sBAAsB,EAAE,YAAY,0BAAmB;;;;GAQ1F;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;GAMzD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,oBAc3D;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,UAAQ,EAAE,YAAY,0BAAmB,8BA4BrI"}
@@ -87,6 +87,7 @@ export const parseAnswers = async function (yes) {
87
87
  runner: runnerPackage.short,
88
88
  preset: presetPackage.short,
89
89
  framework: frameworkPackage.short,
90
+ purpose: runnerPackage.purpose,
90
91
  reporters: reporterPackages.map(({ short }) => short),
91
92
  plugins: pluginPackages.map(({ short }) => short),
92
93
  services: servicePackages.map(({ short }) => short),
@@ -161,7 +161,7 @@ export async function handler(argv) {
161
161
  process.argv.find((arg) => arg.endsWith('ts-node/esm'))) ||
162
162
  NODE_OPTIONS?.includes('ts-node/esm'));
163
163
  if (isTSFile && !runsWithLoader && nodePath) {
164
- NODE_OPTIONS += ' --loader ts-node/esm/transpile-only --no-warnings';
164
+ NODE_OPTIONS += ' -r ts-node/register --loader ts-node/esm/transpile-only --no-warnings';
165
165
  const localTSConfigPath = ((params.autoCompileOpts?.tsNodeOpts?.project &&
166
166
  path.resolve(process.cwd(), params.autoCompileOpts?.tsNodeOpts?.project)) ||
167
167
  path.join(path.dirname(wdioConf.fullPath), 'tsconfig.json'));
@@ -33,11 +33,20 @@ export declare const COMPILER_OPTIONS: {
33
33
  */
34
34
  export declare const SUPPORTED_PACKAGES: {
35
35
  readonly runner: readonly [{
36
- readonly name: "local - for e2e testing of web and mobile applications";
37
- readonly value: "@wdio/local-runner$--$local";
36
+ readonly name: "E2E Testing - of Web or Mobile Applications";
37
+ readonly value: "@wdio/local-runner$--$local$--$e2e";
38
38
  }, {
39
- readonly name: "browser - for unit and component testing in the browser";
40
- readonly value: "@wdio/browser-runner$--$browser";
39
+ readonly name: "Component or Unit Testing - in the browser\n > https://webdriver.io/docs/component-testing";
40
+ readonly value: "@wdio/browser-runner$--$browser$--$component";
41
+ }, {
42
+ readonly name: "Desktop Testing - of Electron Applications\n > https://webdriver.io/docs/desktop-testing/electron";
43
+ readonly value: "@wdio/local-runner$--$local$--$electron";
44
+ }, {
45
+ readonly name: "Desktop Testing - of MacOS Applications\n > https://webdriver.io/docs/desktop-testing/macos";
46
+ readonly value: "@wdio/local-runner$--$local$--$macos";
47
+ }, {
48
+ readonly name: "VS Code Extension Testing\n > https://webdriver.io/docs/vscode-extension-testing";
49
+ readonly value: "@wdio/local-runner$--$local$--$vscode";
41
50
  }];
42
51
  readonly framework: readonly [{
43
52
  readonly name: "Mocha (https://mochajs.org/)";
@@ -124,17 +133,14 @@ export declare const SUPPORTED_PACKAGES: {
124
133
  readonly name: "safaridriver";
125
134
  readonly value: "wdio-safaridriver-service$--$safaridriver";
126
135
  }, {
127
- readonly name: "selenium-standalone";
128
- readonly value: "@wdio/selenium-standalone-service$--$selenium-standalone";
129
- }, {
130
- readonly name: "appium";
131
- readonly value: "@wdio/appium-service$--$appium";
136
+ readonly name: "firefox-profile";
137
+ readonly value: "@wdio/firefox-profile-service$--$firefox-profile";
132
138
  }, {
133
- readonly name: "vscode";
134
- readonly value: "wdio-vscode-service$--$vscode";
139
+ readonly name: "gmail";
140
+ readonly value: "@wdio/gmail-service$--$gmail";
135
141
  }, {
136
- readonly name: "electron";
137
- readonly value: "wdio-electron-service$--$electron";
142
+ readonly name: "vite";
143
+ readonly value: "wdio-vite-service$--$vite";
138
144
  }, {
139
145
  readonly name: "devtools";
140
146
  readonly value: "@wdio/devtools-service$--$devtools";
@@ -151,11 +157,17 @@ export declare const SUPPORTED_PACKAGES: {
151
157
  readonly name: "browserstack";
152
158
  readonly value: "@wdio/browserstack-service$--$browserstack";
153
159
  }, {
154
- readonly name: "firefox-profile";
155
- readonly value: "@wdio/firefox-profile-service$--$firefox-profile";
160
+ readonly name: "vscode";
161
+ readonly value: "wdio-vscode-service$--$vscode";
156
162
  }, {
157
- readonly name: "gmail";
158
- readonly value: "@wdio/gmail-service$--$gmail";
163
+ readonly name: "electron";
164
+ readonly value: "wdio-electron-service$--$electron";
165
+ }, {
166
+ readonly name: "appium";
167
+ readonly value: "@wdio/appium-service$--$appium";
168
+ }, {
169
+ readonly name: "selenium-standalone";
170
+ readonly value: "@wdio/selenium-standalone-service$--$selenium-standalone";
159
171
  }, {
160
172
  readonly name: "eslinter-service";
161
173
  readonly value: "wdio-eslinter-service$--$eslinter";
@@ -253,19 +265,41 @@ export declare const TESTING_LIBRARY_PACKAGES: Record<string, string>;
253
265
  export declare const BACKEND_CHOICES: readonly ["On my local machine", "In the cloud using Experitest", "In the cloud using Sauce Labs", "In the cloud using BrowserStack", "In the cloud using Testingbot or LambdaTest or a different service", "I have my own Selenium cloud"];
254
266
  export declare const PROTOCOL_OPTIONS: readonly ["https", "http"];
255
267
  export declare const REGION_OPTION: readonly ["us", "eu", "apac"];
268
+ export declare const E2E_ENVIRONMENTS: {
269
+ name: string;
270
+ value: string;
271
+ }[];
272
+ export declare const MOBILE_ENVIRONMENTS: {
273
+ name: string;
274
+ value: string;
275
+ }[];
276
+ export declare const BROWSER_ENVIRONMENTS: {
277
+ name: string;
278
+ value: string;
279
+ driver: string;
280
+ }[];
256
281
  declare function isBrowserRunner(answers: Questionnair): boolean;
257
282
  export declare const QUESTIONNAIRE: ({
258
283
  type: string;
259
284
  name: string;
260
285
  message: string;
261
286
  choices: readonly [{
262
- readonly name: "local - for e2e testing of web and mobile applications";
263
- readonly value: "@wdio/local-runner$--$local";
287
+ readonly name: "E2E Testing - of Web or Mobile Applications";
288
+ readonly value: "@wdio/local-runner$--$local$--$e2e";
289
+ }, {
290
+ readonly name: "Component or Unit Testing - in the browser\n > https://webdriver.io/docs/component-testing";
291
+ readonly value: "@wdio/browser-runner$--$browser$--$component";
292
+ }, {
293
+ readonly name: "Desktop Testing - of Electron Applications\n > https://webdriver.io/docs/desktop-testing/electron";
294
+ readonly value: "@wdio/local-runner$--$local$--$electron";
295
+ }, {
296
+ readonly name: "Desktop Testing - of MacOS Applications\n > https://webdriver.io/docs/desktop-testing/macos";
297
+ readonly value: "@wdio/local-runner$--$local$--$macos";
264
298
  }, {
265
- readonly name: "browser - for unit and component testing in the browser";
266
- readonly value: "@wdio/browser-runner$--$browser";
299
+ readonly name: "VS Code Extension Testing\n > https://webdriver.io/docs/vscode-extension-testing";
300
+ readonly value: "@wdio/local-runner$--$local$--$vscode";
267
301
  }];
268
- when: () => boolean;
302
+ when?: undefined;
269
303
  default?: undefined;
270
304
  validate?: undefined;
271
305
  } | {
@@ -294,23 +328,38 @@ export declare const QUESTIONNAIRE: ({
294
328
  type: string;
295
329
  name: string;
296
330
  message: string;
297
- choices: (answers: Questionnair) => readonly ["On my local machine", "In the cloud using Experitest", "In the cloud using Sauce Labs", "In the cloud using BrowserStack", "In the cloud using Testingbot or LambdaTest or a different service", "I have my own Selenium cloud"] | ("On my local machine" | "In the cloud using Experitest" | "In the cloud using Sauce Labs" | "In the cloud using BrowserStack" | "In the cloud using Testingbot or LambdaTest or a different service" | "I have my own Selenium cloud")[];
298
- when?: undefined;
331
+ choices: readonly ["On my local machine", "In the cloud using Experitest", "In the cloud using Sauce Labs", "In the cloud using BrowserStack", "In the cloud using Testingbot or LambdaTest or a different service", "I have my own Selenium cloud"];
332
+ when: (answers: Questionnair) => boolean;
299
333
  default?: undefined;
300
334
  validate?: undefined;
301
335
  } | {
302
336
  type: string;
303
337
  name: string;
304
338
  message: string;
305
- default: boolean;
339
+ choices: {
340
+ name: string;
341
+ value: string;
342
+ }[];
343
+ default: string;
306
344
  when: (answers: Questionnair) => boolean;
307
- choices?: undefined;
308
345
  validate?: undefined;
309
346
  } | {
310
347
  type: string;
311
348
  name: string;
312
349
  message: string;
350
+ choices: {
351
+ name: string;
352
+ value: string;
353
+ driver: string;
354
+ }[];
355
+ default: string[];
313
356
  when: (answers: Questionnair) => boolean;
357
+ validate?: undefined;
358
+ } | {
359
+ type: string;
360
+ name: string;
361
+ message: string;
362
+ when: (answers: Questionnair) => boolean | undefined;
314
363
  choices?: undefined;
315
364
  default?: undefined;
316
365
  validate?: undefined;
@@ -319,7 +368,7 @@ export declare const QUESTIONNAIRE: ({
319
368
  name: string;
320
369
  message: string;
321
370
  default: string;
322
- when: (answers: Questionnair) => boolean;
371
+ when: (answers: Questionnair) => boolean | undefined;
323
372
  choices?: undefined;
324
373
  validate?: undefined;
325
374
  } | {
@@ -377,8 +426,8 @@ export declare const QUESTIONNAIRE: ({
377
426
  name: string;
378
427
  message: string;
379
428
  default: boolean;
429
+ when: (answers: Questionnair) => boolean;
380
430
  choices?: undefined;
381
- when?: undefined;
382
431
  validate?: undefined;
383
432
  } | {
384
433
  type: string;
@@ -489,17 +538,14 @@ export declare const QUESTIONNAIRE: ({
489
538
  readonly name: "safaridriver";
490
539
  readonly value: "wdio-safaridriver-service$--$safaridriver";
491
540
  }, {
492
- readonly name: "selenium-standalone";
493
- readonly value: "@wdio/selenium-standalone-service$--$selenium-standalone";
494
- }, {
495
- readonly name: "appium";
496
- readonly value: "@wdio/appium-service$--$appium";
541
+ readonly name: "firefox-profile";
542
+ readonly value: "@wdio/firefox-profile-service$--$firefox-profile";
497
543
  }, {
498
- readonly name: "vscode";
499
- readonly value: "wdio-vscode-service$--$vscode";
544
+ readonly name: "gmail";
545
+ readonly value: "@wdio/gmail-service$--$gmail";
500
546
  }, {
501
- readonly name: "electron";
502
- readonly value: "wdio-electron-service$--$electron";
547
+ readonly name: "vite";
548
+ readonly value: "wdio-vite-service$--$vite";
503
549
  }, {
504
550
  readonly name: "devtools";
505
551
  readonly value: "@wdio/devtools-service$--$devtools";
@@ -516,11 +562,17 @@ export declare const QUESTIONNAIRE: ({
516
562
  readonly name: "browserstack";
517
563
  readonly value: "@wdio/browserstack-service$--$browserstack";
518
564
  }, {
519
- readonly name: "firefox-profile";
520
- readonly value: "@wdio/firefox-profile-service$--$firefox-profile";
565
+ readonly name: "vscode";
566
+ readonly value: "wdio-vscode-service$--$vscode";
521
567
  }, {
522
- readonly name: "gmail";
523
- readonly value: "@wdio/gmail-service$--$gmail";
568
+ readonly name: "electron";
569
+ readonly value: "wdio-electron-service$--$electron";
570
+ }, {
571
+ readonly name: "appium";
572
+ readonly value: "@wdio/appium-service$--$appium";
573
+ }, {
574
+ readonly name: "selenium-standalone";
575
+ readonly value: "@wdio/selenium-standalone-service$--$selenium-standalone";
524
576
  }, {
525
577
  readonly name: "eslinter-service";
526
578
  readonly value: "wdio-eslinter-service$--$eslinter";
@@ -618,17 +670,14 @@ export declare const QUESTIONNAIRE: ({
618
670
  readonly name: "safaridriver";
619
671
  readonly value: "wdio-safaridriver-service$--$safaridriver";
620
672
  } | {
621
- readonly name: "selenium-standalone";
622
- readonly value: "@wdio/selenium-standalone-service$--$selenium-standalone";
623
- } | {
624
- readonly name: "appium";
625
- readonly value: "@wdio/appium-service$--$appium";
673
+ readonly name: "firefox-profile";
674
+ readonly value: "@wdio/firefox-profile-service$--$firefox-profile";
626
675
  } | {
627
- readonly name: "vscode";
628
- readonly value: "wdio-vscode-service$--$vscode";
676
+ readonly name: "gmail";
677
+ readonly value: "@wdio/gmail-service$--$gmail";
629
678
  } | {
630
- readonly name: "electron";
631
- readonly value: "wdio-electron-service$--$electron";
679
+ readonly name: "vite";
680
+ readonly value: "wdio-vite-service$--$vite";
632
681
  } | {
633
682
  readonly name: "devtools";
634
683
  readonly value: "@wdio/devtools-service$--$devtools";
@@ -645,11 +694,17 @@ export declare const QUESTIONNAIRE: ({
645
694
  readonly name: "browserstack";
646
695
  readonly value: "@wdio/browserstack-service$--$browserstack";
647
696
  } | {
648
- readonly name: "firefox-profile";
649
- readonly value: "@wdio/firefox-profile-service$--$firefox-profile";
697
+ readonly name: "vscode";
698
+ readonly value: "wdio-vscode-service$--$vscode";
650
699
  } | {
651
- readonly name: "gmail";
652
- readonly value: "@wdio/gmail-service$--$gmail";
700
+ readonly name: "electron";
701
+ readonly value: "wdio-electron-service$--$electron";
702
+ } | {
703
+ readonly name: "appium";
704
+ readonly value: "@wdio/appium-service$--$appium";
705
+ } | {
706
+ readonly name: "selenium-standalone";
707
+ readonly value: "@wdio/selenium-standalone-service$--$selenium-standalone";
653
708
  } | {
654
709
  readonly name: "eslinter-service";
655
710
  readonly value: "wdio-eslinter-service$--$eslinter";
@@ -734,10 +789,18 @@ export declare const QUESTIONNAIRE: ({
734
789
  } | {
735
790
  readonly name: "robonut";
736
791
  readonly value: "wdio-robonut-service$--$robonut";
737
- })[];
738
- default: (answers: Questionnair) => ("wdio-chromedriver-service$--$chromedriver" | "wdio-geckodriver-service$--$geckodriver" | "wdio-edgedriver-service$--$edgedriver" | "wdio-safaridriver-service$--$safaridriver" | "@wdio/selenium-standalone-service$--$selenium-standalone" | "@wdio/appium-service$--$appium" | "wdio-vscode-service$--$vscode" | "wdio-electron-service$--$electron" | "@wdio/devtools-service$--$devtools" | "@wdio/sauce-service$--$sauce" | "@wdio/testingbot-service$--$testingbot" | "@wdio/crossbrowsertesting-service$--$crossbrowsertesting" | "@wdio/browserstack-service$--$browserstack" | "@wdio/firefox-profile-service$--$firefox-profile" | "@wdio/gmail-service$--$gmail" | "wdio-eslinter-service$--$eslinter" | "wdio-lambdatest-service$--$lambdatest" | "wdio-zafira-listener-service$--$zafira-listener" | "wdio-reportportal-service$--$reportportal" | "wdio-docker-service$--$docker" | "wdio-ui5-service$--$ui5" | "wdio-wiremock-service$--$wiremock" | "wdio-ng-apimock-service$--ng-apimock" | "wdio-slack-service$--$slack" | "wdio-cucumber-viewport-logger-service$--$cucumber-viewport-logger" | "wdio-intercept-service$--$intercept" | "wdio-image-comparison-service$--$image-comparison" | "wdio-novus-visual-regression-service$--$novus-visual-regression" | "wdio-rerun-service$--$rerun" | "wdio-winappdriver-service$--$winappdriver" | "wdio-ywinappdriver-service$--$ywinappdriver" | "wdio-performancetotal-service$--$performancetotal" | "wdio-cleanuptotal-service$--$cleanuptotal" | "wdio-aws-device-farm-service$--$aws-device-farm" | "wdio-ocr-service$--$ocr-native-apps" | "wdio-ms-teams-service$--$ms-teams" | "wdio-tesults-service$--$tesults" | "@gmangiapelo/wdio-azure-devops-service$--$azure-devops" | "wdio-google-chat-service$--$google-chat" | "@sap_oss/wdio-qmate-service$--$qmate-service" | "wdio-vitaqai-service$--$vitaqai" | "wdio-robonut-service$--$robonut" | undefined)[];
792
+ } | undefined)[];
793
+ default: (answers: Questionnair) => ("wdio-chromedriver-service$--$chromedriver" | "wdio-geckodriver-service$--$geckodriver" | "wdio-edgedriver-service$--$edgedriver" | "wdio-safaridriver-service$--$safaridriver" | "@wdio/firefox-profile-service$--$firefox-profile" | "@wdio/gmail-service$--$gmail" | "wdio-vite-service$--$vite" | "@wdio/devtools-service$--$devtools" | "@wdio/sauce-service$--$sauce" | "@wdio/testingbot-service$--$testingbot" | "@wdio/crossbrowsertesting-service$--$crossbrowsertesting" | "@wdio/browserstack-service$--$browserstack" | "wdio-vscode-service$--$vscode" | "wdio-electron-service$--$electron" | "@wdio/appium-service$--$appium" | "@wdio/selenium-standalone-service$--$selenium-standalone" | "wdio-eslinter-service$--$eslinter" | "wdio-lambdatest-service$--$lambdatest" | "wdio-zafira-listener-service$--$zafira-listener" | "wdio-reportportal-service$--$reportportal" | "wdio-docker-service$--$docker" | "wdio-ui5-service$--$ui5" | "wdio-wiremock-service$--$wiremock" | "wdio-ng-apimock-service$--ng-apimock" | "wdio-slack-service$--$slack" | "wdio-cucumber-viewport-logger-service$--$cucumber-viewport-logger" | "wdio-intercept-service$--$intercept" | "wdio-image-comparison-service$--$image-comparison" | "wdio-novus-visual-regression-service$--$novus-visual-regression" | "wdio-rerun-service$--$rerun" | "wdio-winappdriver-service$--$winappdriver" | "wdio-ywinappdriver-service$--$ywinappdriver" | "wdio-performancetotal-service$--$performancetotal" | "wdio-cleanuptotal-service$--$cleanuptotal" | "wdio-aws-device-farm-service$--$aws-device-farm" | "wdio-ocr-service$--$ocr-native-apps" | "wdio-ms-teams-service$--$ms-teams" | "wdio-tesults-service$--$tesults" | "@gmangiapelo/wdio-azure-devops-service$--$azure-devops" | "wdio-google-chat-service$--$google-chat" | "@sap_oss/wdio-qmate-service$--$qmate-service" | "wdio-vitaqai-service$--$vitaqai" | "wdio-robonut-service$--$robonut" | undefined)[];
739
794
  validate: (answers: string[]) => string | Boolean;
740
795
  when?: undefined;
796
+ } | {
797
+ type: string;
798
+ name: string;
799
+ message: string;
800
+ default: boolean;
801
+ choices?: undefined;
802
+ when?: undefined;
803
+ validate?: undefined;
741
804
  })[];
742
805
  export {};
743
806
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAG9C,eAAO,MAAM,GAAG,KAA6B,CAAA;AAE7C,eAAO,MAAM,YAAY,Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAiBZ,YAAY;wBAgBgB,MAAM,EAAE;;;;;;;;;;IAsCzD,CAAA"}
@@ -58,8 +58,11 @@ export const COMPILER_OPTIONS = {
58
58
  */
59
59
  export const SUPPORTED_PACKAGES = {
60
60
  runner: [
61
- { name: 'local - for e2e testing of web and mobile applications', value: '@wdio/local-runner$--$local' },
62
- { name: 'browser - for unit and component testing in the browser', value: '@wdio/browser-runner$--$browser' }
61
+ { name: 'E2E Testing - of Web or Mobile Applications', value: '@wdio/local-runner$--$local$--$e2e' },
62
+ { name: 'Component or Unit Testing - in the browser\n > https://webdriver.io/docs/component-testing', value: '@wdio/browser-runner$--$browser$--$component' },
63
+ { name: 'Desktop Testing - of Electron Applications\n > https://webdriver.io/docs/desktop-testing/electron', value: '@wdio/local-runner$--$local$--$electron' },
64
+ { name: 'Desktop Testing - of MacOS Applications\n > https://webdriver.io/docs/desktop-testing/macos', value: '@wdio/local-runner$--$local$--$macos' },
65
+ { name: 'VS Code Extension Testing\n > https://webdriver.io/docs/vscode-extension-testing', value: '@wdio/local-runner$--$local$--$vscode' }
63
66
  ],
64
67
  framework: [
65
68
  { name: 'Mocha (https://mochajs.org/)', value: '@wdio/mocha-framework$--$mocha' },
@@ -99,17 +102,18 @@ export const SUPPORTED_PACKAGES = {
99
102
  { name: 'edgedriver', value: 'wdio-edgedriver-service$--$edgedriver' },
100
103
  { name: 'safaridriver', value: 'wdio-safaridriver-service$--$safaridriver' },
101
104
  // internal
102
- { name: 'selenium-standalone', value: '@wdio/selenium-standalone-service$--$selenium-standalone' },
103
- { name: 'appium', value: '@wdio/appium-service$--$appium' },
104
- { name: 'vscode', value: 'wdio-vscode-service$--$vscode' },
105
- { name: 'electron', value: 'wdio-electron-service$--$electron' },
105
+ { name: 'firefox-profile', value: '@wdio/firefox-profile-service$--$firefox-profile' },
106
+ { name: 'gmail', value: '@wdio/gmail-service$--$gmail' },
107
+ { name: 'vite', value: 'wdio-vite-service$--$vite' },
106
108
  { name: 'devtools', value: '@wdio/devtools-service$--$devtools' },
107
109
  { name: 'sauce', value: '@wdio/sauce-service$--$sauce' },
108
110
  { name: 'testingbot', value: '@wdio/testingbot-service$--$testingbot' },
109
111
  { name: 'crossbrowsertesting', value: '@wdio/crossbrowsertesting-service$--$crossbrowsertesting' },
110
112
  { name: 'browserstack', value: '@wdio/browserstack-service$--$browserstack' },
111
- { name: 'firefox-profile', value: '@wdio/firefox-profile-service$--$firefox-profile' },
112
- { name: 'gmail', value: '@wdio/gmail-service$--$gmail' },
113
+ { name: 'vscode', value: 'wdio-vscode-service$--$vscode' },
114
+ { name: 'electron', value: 'wdio-electron-service$--$electron' },
115
+ { name: 'appium', value: '@wdio/appium-service$--$appium' },
116
+ { name: 'selenium-standalone', value: '@wdio/selenium-standalone-service$--$selenium-standalone' },
113
117
  // external
114
118
  { name: 'eslinter-service', value: 'wdio-eslinter-service$--$eslinter' },
115
119
  { name: 'lambdatest', value: 'wdio-lambdatest-service$--$lambdatest' },
@@ -174,12 +178,30 @@ export const REGION_OPTION = [
174
178
  'eu',
175
179
  'apac'
176
180
  ];
177
- function isLocalEnvironment(answers) {
178
- return answers.runner === SUPPORTED_PACKAGES.runner[0].value;
179
- }
181
+ export const E2E_ENVIRONMENTS = [
182
+ { name: 'Web - web applications in the browser', value: 'web' },
183
+ { name: 'Mobile - native, hybrid and mobile web apps, on Android or iOS', value: 'mobile' }
184
+ ];
185
+ export const MOBILE_ENVIRONMENTS = [
186
+ { name: 'Android - native, hybrid and mobile web apps, tested on emulators and real devices\n > using UiAutomator2 (https://www.npmjs.com/package/appium-uiautomator2-driver)', value: 'android' },
187
+ { name: 'iOS - applications on iOS, iPadOS, and tvOS\n > using XCTest (https://appium.github.io/appium-xcuitest-driver)', value: 'ios' }
188
+ ];
189
+ export const BROWSER_ENVIRONMENTS = [
190
+ { name: 'Chrome', value: 'chrome', driver: 'chromedriver' },
191
+ { name: 'Firefox', value: 'firefox', driver: 'geckodriver' },
192
+ { name: 'Safari', value: 'safari', driver: 'safaridriver' },
193
+ { name: 'Microsoft Edge', value: 'MicrosoftEdge', driver: 'edgedriver' }
194
+ ];
180
195
  function isBrowserRunner(answers) {
181
196
  return answers.runner === SUPPORTED_PACKAGES.runner[1].value;
182
197
  }
198
+ function getTestingPurpose(answers) {
199
+ return convertPackageHashToObject(answers.runner).purpose;
200
+ }
201
+ function getBrowserDriver(browserName) {
202
+ const driverName = BROWSER_ENVIRONMENTS.find((browser) => browser.value === browserName)?.driver;
203
+ return SUPPORTED_PACKAGES.service.find((svc) => svc.name === driverName)?.value;
204
+ }
183
205
  function selectDefaultService(serviceName) {
184
206
  return [SUPPORTED_PACKAGES.service.find(
185
207
  /* istanbul ignore next */
@@ -193,10 +215,8 @@ function prioServiceOrderFor(serviceName) {
193
215
  export const QUESTIONNAIRE = [{
194
216
  type: 'list',
195
217
  name: 'runner',
196
- message: 'Where should your tests be launched?',
197
- choices: SUPPORTED_PACKAGES.runner,
198
- // only ask if there are more than 1 runner to pick from
199
- when: /* istanbul ignore next */ () => SUPPORTED_PACKAGES.runner.length > 1
218
+ message: 'What type of testing would you like to do?',
219
+ choices: SUPPORTED_PACKAGES.runner
200
220
  }, {
201
221
  type: 'list',
202
222
  name: 'preset',
@@ -215,38 +235,52 @@ export const QUESTIONNAIRE = [{
215
235
  * Only show if Testing Library has an add-on for framework
216
236
  */
217
237
  answers.preset && TESTING_LIBRARY_PACKAGES[convertPackageHashToObject(answers.preset).short])
238
+ }, {
239
+ type: 'input',
240
+ name: 'appPath',
241
+ message: 'What is the path to your compiled Electron app?',
242
+ default: './dist',
243
+ when: /* istanbul ignore next */ (answers) => getTestingPurpose(answers) === 'electron'
218
244
  }, {
219
245
  type: 'list',
220
246
  name: 'backend',
221
247
  message: 'Where is your automation backend located?',
222
- choices: /* instanbul ignore next */ (answers) => {
223
- /**
224
- * browser runner currently supports only local testing
225
- * until we have tunnel support for other cloud vendors
226
- */
227
- if (isBrowserRunner(answers)) {
228
- return BACKEND_CHOICES.slice(0, 1);
229
- }
230
- return BACKEND_CHOICES;
231
- }
248
+ choices: BACKEND_CHOICES,
249
+ when: /* instanbul ignore next */ (answers) => getTestingPurpose(answers) === 'e2e'
232
250
  }, {
233
- type: 'confirm',
234
- name: 'setupMobileEnvironment',
235
- message: 'Would you like to setup Appium for mobile testing?',
236
- default: false,
237
- when: /* istanbul ignore next */ (answers) => (isLocalEnvironment(answers) &&
251
+ type: 'list',
252
+ name: 'e2eEnvironment',
253
+ message: 'Which environment you would like to automate?',
254
+ choices: E2E_ENVIRONMENTS,
255
+ default: 'web',
256
+ when: /* istanbul ignore next */ (answers) => (getTestingPurpose(answers) === 'e2e' &&
238
257
  answers.backend === BACKEND_CHOICES[0])
258
+ }, {
259
+ type: 'list',
260
+ name: 'mobileEnvironment',
261
+ message: 'Which mobile environment you\'ld like to automate?',
262
+ choices: MOBILE_ENVIRONMENTS,
263
+ when: /* instanbul ignore next */ (answers) => (getTestingPurpose(answers) === 'e2e' &&
264
+ answers.e2eEnvironment === 'mobile')
265
+ }, {
266
+ type: 'checkbox',
267
+ name: 'browserEnvironment',
268
+ message: 'With which browser should we start?',
269
+ choices: BROWSER_ENVIRONMENTS,
270
+ default: ['chrome'],
271
+ when: /* instanbul ignore next */ (answers) => (getTestingPurpose(answers) === 'e2e' &&
272
+ answers.e2eEnvironment === 'web')
239
273
  }, {
240
274
  type: 'input',
241
275
  name: 'hostname',
242
276
  message: 'What is the host address of that cloud service?',
243
- when: /* istanbul ignore next */ (answers) => answers.backend.toString().indexOf('different service') > -1
277
+ when: /* istanbul ignore next */ (answers) => answers.backend && answers.backend.indexOf('different service') > -1
244
278
  }, {
245
279
  type: 'input',
246
280
  name: 'port',
247
281
  message: 'What is the port on which that service is running?',
248
282
  default: '80',
249
- when: /* istanbul ignore next */ (answers) => answers.backend.toString().indexOf('different service') > -1
283
+ when: /* istanbul ignore next */ (answers) => answers.backend && answers.backend.indexOf('different service') > -1
250
284
  }, {
251
285
  type: 'input',
252
286
  name: 'expEnvAccessKey',
@@ -279,14 +313,14 @@ export const QUESTIONNAIRE = [{
279
313
  name: 'env_user',
280
314
  message: 'Environment variable for username',
281
315
  default: 'LT_USERNAME',
282
- when: /* istanbul ignore next */ (answers) => (answers.backend.toString().indexOf('LambdaTest') > -1 &&
316
+ when: /* istanbul ignore next */ (answers) => (answers.backend && answers.backend.indexOf('LambdaTest') > -1 &&
283
317
  answers.hostname.indexOf('lambdatest.com') > -1)
284
318
  }, {
285
319
  type: 'input',
286
320
  name: 'env_key',
287
321
  message: 'Environment variable for access key',
288
322
  default: 'LT_ACCESS_KEY',
289
- when: /* istanbul ignore next */ (answers) => (answers.backend.toString().indexOf('LambdaTest') > -1 &&
323
+ when: /* istanbul ignore next */ (answers) => (answers.backend && answers.backend.indexOf('LambdaTest') > -1 &&
290
324
  answers.hostname.indexOf('lambdatest.com') > -1)
291
325
  }, {
292
326
  type: 'input',
@@ -323,19 +357,19 @@ export const QUESTIONNAIRE = [{
323
357
  name: 'hostname',
324
358
  message: 'What is the IP or URI to your Selenium standalone or grid server?',
325
359
  default: 'localhost',
326
- when: /* istanbul ignore next */ (answers) => answers.backend.toString().indexOf('own Selenium cloud') > -1
360
+ when: /* istanbul ignore next */ (answers) => answers.backend && answers.backend.toString().indexOf('own Selenium cloud') > -1
327
361
  }, {
328
362
  type: 'input',
329
363
  name: 'port',
330
364
  message: 'What is the port which your Selenium standalone or grid server is running on?',
331
365
  default: '4444',
332
- when: /* istanbul ignore next */ (answers) => answers.backend.toString().indexOf('own Selenium cloud') > -1
366
+ when: /* istanbul ignore next */ (answers) => answers.backend && answers.backend.toString().indexOf('own Selenium cloud') > -1
333
367
  }, {
334
368
  type: 'input',
335
369
  name: 'path',
336
370
  message: 'What is the path to your browser driver or grid server?',
337
371
  default: '/',
338
- when: /* istanbul ignore next */ (answers) => answers.backend.toString().indexOf('own Selenium cloud') > -1
372
+ when: /* istanbul ignore next */ (answers) => answers.backend && answers.backend.toString().indexOf('own Selenium cloud') > -1
339
373
  }, {
340
374
  type: 'list',
341
375
  name: 'framework',
@@ -359,7 +393,16 @@ export const QUESTIONNAIRE = [{
359
393
  type: 'confirm',
360
394
  name: 'generateTestFiles',
361
395
  message: 'Do you want WebdriverIO to autogenerate some test files?',
362
- default: true
396
+ default: true,
397
+ when: /* istanbul ignore next */ (answers) => {
398
+ /**
399
+ * we only have examples for Mocha and Jasmine
400
+ */
401
+ if (['vscode', 'electron', 'macos'].includes(getTestingPurpose(answers)) && answers.framework.includes('cucumber')) {
402
+ return false;
403
+ }
404
+ return true;
405
+ }
363
406
  }, {
364
407
  type: 'input',
365
408
  name: 'specs',
@@ -390,7 +433,12 @@ export const QUESTIONNAIRE = [{
390
433
  /**
391
434
  * page objects aren't common for component testing
392
435
  */
393
- !isBrowserRunner(answers))
436
+ !isBrowserRunner(answers) &&
437
+ /**
438
+ * and also not needed when running VS Code tests since the service comes with
439
+ * its own page object implementation, nor when running Electron or MacOS tests
440
+ */
441
+ !['vscode', 'electron', 'macos'].includes(getTestingPurpose(answers)))
394
442
  }, {
395
443
  type: 'input',
396
444
  name: 'pages',
@@ -426,9 +474,18 @@ export const QUESTIONNAIRE = [{
426
474
  else if (answers.backend === BACKEND_CHOICES[2]) {
427
475
  return prioServiceOrderFor('sauce');
428
476
  }
429
- else if (answers.setupMobileEnvironment) {
477
+ else if (answers.e2eEnvironment === 'mobile') {
430
478
  return prioServiceOrderFor('appium');
431
479
  }
480
+ else if (getTestingPurpose(answers) === 'vscode') {
481
+ return [SUPPORTED_PACKAGES.service.find(({ name }) => name === 'vscode')];
482
+ }
483
+ else if (getTestingPurpose(answers) === 'electron') {
484
+ return [SUPPORTED_PACKAGES.service.find(({ name }) => name === 'electron')];
485
+ }
486
+ else if (getTestingPurpose(answers) === 'macos') {
487
+ return [SUPPORTED_PACKAGES.service.find(({ name }) => name === 'appium')];
488
+ }
432
489
  return SUPPORTED_PACKAGES.service;
433
490
  },
434
491
  // @ts-ignore
@@ -439,9 +496,18 @@ export const QUESTIONNAIRE = [{
439
496
  else if (answers.backend === BACKEND_CHOICES[2]) {
440
497
  return selectDefaultService('sauce');
441
498
  }
442
- else if (answers.setupMobileEnvironment) {
499
+ else if (answers.browserEnvironment && answers.browserEnvironment.length) {
500
+ return answers.browserEnvironment.map((browserName) => getBrowserDriver(browserName));
501
+ }
502
+ else if (answers.e2eEnvironment === 'mobile' || getTestingPurpose(answers) === 'macos') {
443
503
  return selectDefaultService('appium');
444
504
  }
505
+ else if (getTestingPurpose(answers) === 'vscode') {
506
+ return selectDefaultService('vscode');
507
+ }
508
+ else if (getTestingPurpose(answers) === 'electron') {
509
+ return selectDefaultService('electron');
510
+ }
445
511
  return selectDefaultService('chromedriver');
446
512
  },
447
513
  validate: /* istanbul ignore next */ (answers) => validateServiceAnswers(answers)
@@ -473,7 +539,9 @@ export const QUESTIONNAIRE = [{
473
539
  // unit and component testing in the browser
474
540
  !isBrowserRunner(answers) &&
475
541
  // mobile testing with Appium
476
- !answers.setupMobileEnvironment)
542
+ answers.e2eEnvironment !== 'mobile' &&
543
+ // nor for VS Code, Electron or MacOS testing
544
+ !['vscode', 'electron', 'macos'].includes(getTestingPurpose(answers)))
477
545
  }, {
478
546
  type: 'confirm',
479
547
  name: 'npmInstall',