create-wdio 9.0.0 → 9.17.1

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 (83) hide show
  1. package/README.md +12 -7
  2. package/assets/demo.gif +0 -0
  3. package/build/cli/config.d.ts +51 -0
  4. package/build/cli/config.d.ts.map +1 -0
  5. package/build/cli/install.d.ts +12 -0
  6. package/build/cli/install.d.ts.map +1 -0
  7. package/build/cli/utils.d.ts +18 -0
  8. package/build/cli/utils.d.ts.map +1 -0
  9. package/build/config/cli.d.ts +2 -0
  10. package/build/config/cli.d.ts.map +1 -0
  11. package/build/config/cli.js +1632 -0
  12. package/build/constants.d.ts +248 -0
  13. package/build/constants.d.ts.map +1 -0
  14. package/build/index.d.ts +4 -0
  15. package/build/index.d.ts.map +1 -0
  16. package/build/index.js +1018 -54
  17. package/build/install/cli.d.ts +2 -0
  18. package/build/install/cli.d.ts.map +1 -0
  19. package/build/install/cli.js +1719 -0
  20. package/build/install.d.ts +4 -0
  21. package/build/install.d.ts.map +1 -0
  22. package/build/templates/EjsHelpers.d.ts +18 -0
  23. package/build/templates/EjsHelpers.d.ts.map +1 -0
  24. package/build/templates/exampleFiles/browser/Component.css.ejs +121 -0
  25. package/build/templates/exampleFiles/browser/Component.lit.ejs +154 -0
  26. package/build/templates/exampleFiles/browser/Component.lit.test.ejs +24 -0
  27. package/build/templates/exampleFiles/browser/Component.preact.ejs +28 -0
  28. package/build/templates/exampleFiles/browser/Component.preact.test.ejs +59 -0
  29. package/build/templates/exampleFiles/browser/Component.react.ejs +29 -0
  30. package/build/templates/exampleFiles/browser/Component.react.test.ejs +58 -0
  31. package/build/templates/exampleFiles/browser/Component.solid.ejs +28 -0
  32. package/build/templates/exampleFiles/browser/Component.solid.test.ejs +58 -0
  33. package/build/templates/exampleFiles/browser/Component.stencil.ejs +43 -0
  34. package/build/templates/exampleFiles/browser/Component.stencil.test.ejs +45 -0
  35. package/build/templates/exampleFiles/browser/Component.svelte.ejs +47 -0
  36. package/build/templates/exampleFiles/browser/Component.svelte.test.ejs +58 -0
  37. package/build/templates/exampleFiles/browser/Component.vue.ejs +34 -0
  38. package/build/templates/exampleFiles/browser/Component.vue.test.ejs +62 -0
  39. package/build/templates/exampleFiles/browser/standalone.test.ejs +13 -0
  40. package/build/templates/exampleFiles/cucumber/features/login.feature +12 -0
  41. package/build/templates/exampleFiles/cucumber/step_definitions/steps.js.ejs +55 -0
  42. package/build/templates/exampleFiles/mochaJasmine/test.e2e.js.ejs +11 -0
  43. package/build/templates/exampleFiles/pageobjects/login.page.js.ejs +45 -0
  44. package/build/templates/exampleFiles/pageobjects/page.js.ejs +17 -0
  45. package/build/templates/exampleFiles/pageobjects/secure.page.js.ejs +20 -0
  46. package/build/templates/exampleFiles/serenity-js/common/config/serenity.properties.ejs +1 -0
  47. package/build/templates/exampleFiles/serenity-js/common/serenity/github-api/GitHubStatus.ts.ejs +41 -0
  48. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoList.ts.ejs +100 -0
  49. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoListItem.ts.ejs +36 -0
  50. package/build/templates/exampleFiles/serenity-js/cucumber/step-definitions/steps.ts.ejs +37 -0
  51. package/build/templates/exampleFiles/serenity-js/cucumber/support/parameter.config.ts.ejs +18 -0
  52. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/completing_items.feature.ejs +23 -0
  53. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/narrative.md.ejs +17 -0
  54. package/build/templates/exampleFiles/serenity-js/jasmine/example.spec.ts.ejs +86 -0
  55. package/build/templates/exampleFiles/serenity-js/mocha/example.spec.ts.ejs +88 -0
  56. package/build/templates/snippets/afterTest.ejs +20 -0
  57. package/build/templates/snippets/capabilities.ejs +57 -0
  58. package/build/templates/snippets/cucumber.ejs +50 -0
  59. package/build/templates/snippets/electronTest.js.ejs +7 -0
  60. package/build/templates/snippets/jasmine.ejs +20 -0
  61. package/build/templates/snippets/macosTest.js.ejs +11 -0
  62. package/build/templates/snippets/mocha.ejs +14 -0
  63. package/build/templates/snippets/reporters.ejs +14 -0
  64. package/build/templates/snippets/serenity.ejs +18 -0
  65. package/build/templates/snippets/services.ejs +18 -0
  66. package/build/templates/snippets/testWithPO.js.ejs +22 -0
  67. package/build/templates/snippets/testWithoutPO.js.ejs +19 -0
  68. package/build/templates/snippets/vscodeTest.js.ejs +9 -0
  69. package/build/templates/wdio.conf.tpl.ejs +412 -0
  70. package/build/types.d.ts +99 -0
  71. package/build/types.d.ts.map +1 -0
  72. package/build/utils/index.d.ts +2 -0
  73. package/build/utils/index.d.ts.map +1 -0
  74. package/build/utils/index.js +849 -0
  75. package/build/utils.d.ts +78 -0
  76. package/build/utils.d.ts.map +1 -0
  77. package/package.json +60 -41
  78. package/.eslintrc.cjs +0 -37
  79. package/__mocks__/commander.ts +0 -18
  80. package/build/constants.js +0 -51
  81. package/build/types.js +0 -1
  82. package/build/utils.js +0 -38
  83. package/vitest.config.ts +0 -23
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- WebdriverIO Starter Toolkit [![Test Changes](https://github.com/webdriverio/create-wdio/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/webdriverio/create-wdio/actions/workflows/test.yml) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/webdriverio/create-wdio/blob/main/CONTRIBUTING.md)
1
+ WebdriverIO Starter Toolkit [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/webdriverio/webdriverio/blob/main/CONTRIBUTING.md)
2
2
  ===========================
3
3
 
4
4
  <img alt="Logo" align="right" src="https://webdriver.io/assets/images/robot-3677788dd63849c56aa5cb3f332b12d5.svg" width="20%" />
@@ -9,11 +9,11 @@ One command to create a fresh WebdriverIO project or add WebdriverIO to an exist
9
9
  - [Supported Options](#supported-options) - command line parameters
10
10
 
11
11
  `create-wdio` works on macOS, Windows, and Linux.<br>
12
- If something doesn’t work, please [file an issue](https://github.com/webdriverio/create-wdio/issues/new).<br>
13
- If you have questions or need help, please ask in our [Gitter Support Chat](https://gitter.im/webdriverio/webdriverio).
12
+ If something doesn’t work, please [file an issue](https://github.com/webdriverio/webdriverio/issues/new).<br>
13
+ If you have questions or need help, please ask in our [Discord Support channel](https://discord.webdriver.io).
14
14
 
15
15
  <p align="center">
16
- <img src="https://raw.githubusercontent.com/webdriverio/wdio/main/.github/assets/demo.gif" alt="Example" />
16
+ <img src="https://raw.githubusercontent.com/webdriverio/webdriverio/main/packages/create-wdio/assets/demo.gif" alt="Example" />
17
17
  </p>
18
18
 
19
19
  ## Usage
@@ -34,7 +34,7 @@ _[`npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f
34
34
  npm init wdio@latest ./e2e
35
35
  ```
36
36
 
37
- _[`npm init <initializer>`](https://docs.npmjs.com/cli/v7/commands/npm-init) is available in npm 6+_
37
+ _[`npm init <initializer>`](https://docs.npmjs.com/cli/v10/commands/npm-init) is available in npm 6+_
38
38
 
39
39
  #### yarn
40
40
 
@@ -44,6 +44,13 @@ yarn create wdio@latest ./e2e
44
44
 
45
45
  _[`yarn create <starter-kit-package>`](https://yarnpkg.com/lang/en/docs/cli/create/) is available in Yarn 0.25+_
46
46
 
47
+ #### pnpm
48
+
49
+ ```sh
50
+ pnpm create wdio ./e2e
51
+ ```
52
+
53
+ _[`pnpm create <starter-kit-package>`](https://pnpm.io/cli/create) is available in pnpm v7+_
47
54
 
48
55
  It will create a directory called `e2e` inside the current folder.
49
56
  Then it will run the configuration wizard that will help you set-up your framework.
@@ -55,9 +62,7 @@ You can pass the following command line flags to modify the bootstrap mechanism:
55
62
 
56
63
  * `--dev` - Install all packages as `devDependencies` (default: `true`)
57
64
  * `--yes` - Will fill in all config defaults without prompting (default: `false`)
58
- * `--use-yarn` - yes, we support yarn too! (default: `true`)
59
65
  * `--npm-tag` - use a specific NPM tag for `@wdio/cli` package (default: `latest`)
60
- * `--verbose` - print additional logs (default: `false`)
61
66
 
62
67
  ----
63
68
 
Binary file
@@ -0,0 +1,51 @@
1
+ import type { Argv } from 'yargs';
2
+ import { runConfigCommand } from './utils.js';
3
+ import type { ConfigCommandArguments } from '../types.js';
4
+ export declare const command = "config";
5
+ export declare const desc = "Initialize WebdriverIO and setup configuration in your current project.";
6
+ export declare const cmdArgs: {
7
+ readonly yarn: {
8
+ readonly type: "boolean";
9
+ readonly desc: "Install packages via Yarn package manager.";
10
+ readonly default: boolean;
11
+ };
12
+ readonly yes: {
13
+ readonly alias: "y";
14
+ readonly desc: "will fill in all config defaults without prompting";
15
+ readonly type: "boolean";
16
+ readonly default: false;
17
+ };
18
+ readonly npmTag: {
19
+ readonly alias: "t";
20
+ readonly desc: "define NPM tag to use for WebdriverIO related packages";
21
+ readonly type: "string";
22
+ readonly default: "latest";
23
+ };
24
+ };
25
+ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "yarn" | "yes" | "npmTag"> & import("yargs").InferredOptionTypes<{
26
+ readonly yarn: {
27
+ readonly type: "boolean";
28
+ readonly desc: "Install packages via Yarn package manager.";
29
+ readonly default: boolean;
30
+ };
31
+ readonly yes: {
32
+ readonly alias: "y";
33
+ readonly desc: "will fill in all config defaults without prompting";
34
+ readonly type: "boolean";
35
+ readonly default: false;
36
+ };
37
+ readonly npmTag: {
38
+ readonly alias: "t";
39
+ readonly desc: "define NPM tag to use for WebdriverIO related packages";
40
+ readonly type: "string";
41
+ readonly default: "latest";
42
+ };
43
+ }>>;
44
+ export declare function handler(argv: ConfigCommandArguments, runConfigCmd?: typeof runConfigCommand): Promise<{
45
+ success: boolean;
46
+ parsedAnswers: import("../types.js").ParsedAnswers;
47
+ installedPackages: string[];
48
+ }>;
49
+ export { missingConfigurationPrompt, canAccessConfigPath } from './utils.js';
50
+ export { formatConfigFilePaths } from '../utils.js';
51
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAEH,gBAAgB,EACnB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAUzD,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,IAAI,4EAA4E,CAAA;AAE7F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBV,CAAA;AAEV,eAAO,MAAM,OAAO,GAAI,OAAO,IAAI;;;;;;;;;;;;;;;;;;GAKlC,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,sBAAsB,EAAE,YAAY,0BAAmB;;;;GAQ1F;AAED,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAG,MAAM,YAAY,CAAA;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { Argv } from 'yargs';
2
+ import type { InstallCommandArguments } from '../types.js';
3
+ export declare const command = "install <type> <name>";
4
+ export declare const desc: string;
5
+ export declare const cmdArgs: {
6
+ readonly config: {
7
+ readonly desc: "Location of your WDIO configuration (default: wdio.conf.(js|ts|cjs|mjs))";
8
+ };
9
+ };
10
+ export declare const builder: (yargs: Argv) => Argv<{}>;
11
+ export declare function handler(argv: InstallCommandArguments): Promise<void>;
12
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/cli/install.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAcjC,OAAO,KAAK,EAAE,uBAAuB,EAAoB,MAAM,aAAa,CAAA;AAW5E,eAAO,MAAM,OAAO,0BAA0B,CAAA;AAC9C,eAAO,MAAM,IAAI,QAIN,CAAA;AAEX,eAAO,MAAM,OAAO;;;;CAIV,CAAA;AAEV,eAAO,MAAM,OAAO,GAAI,OAAO,IAAI,aAalC,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,uBAAuB,iBAiF1D"}
@@ -0,0 +1,18 @@
1
+ import type { ParsedAnswers } from '../types.js';
2
+ export declare function runConfigCommand(parsedAnswers: ParsedAnswers, npmTag: string): Promise<void>;
3
+ /**
4
+ * Helper utility used in `run` and `install` command to create config if none exist
5
+ * @param {string} command to be executed by user
6
+ * @param {string} configPath the path to a wdio.conf.[js/ts] file
7
+ * @param {Function} runConfigCmd runConfig method to be replaceable for unit testing
8
+ */
9
+ export declare function missingConfigurationPrompt(command: string, configPath: string, runConfigCmd?: Function): Promise<string>;
10
+ export declare const parseAnswers: (yes: boolean) => Promise<ParsedAnswers>;
11
+ /**
12
+ * Helper utility used in `run` and `install` command to check whether a config file currently exists
13
+ * @param configPathNoExtension the file path to the WDIO config file without extension
14
+ * @param configPath the file path to the WDIO config file that is checked first if set
15
+ * @returns {string} the path to the config file that exists, otherwise undefined
16
+ */
17
+ export declare function canAccessConfigPath(configPathNoExtension: string, configPath?: string): Promise<string | undefined>;
18
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/cli/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAqBlF;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAE,QAA2B,mBA+B9H;AAED,eAAO,MAAM,YAAY,GAAmB,KAAK,OAAO,KAAG,OAAO,CAAC,aAAa,CAyF/E,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,qBAAqB,EAAC,MAAM,EAAE,UAAU,CAAC,EAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CAcrH"}
@@ -0,0 +1,2 @@
1
+ export * as config from '../cli/config.js';
2
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/config/cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAA"}