create-wdio 7.0.1 ā 7.1.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.
- package/README.md +12 -3
- package/build/index.js +11 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,19 +17,26 @@ If you have questions or need help, please ask in our [Gitter Support Chat](http
|
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
|
+
|
|
20
21
|
To install a WebdriverIO project, you may choose one of the following methods:
|
|
21
22
|
|
|
23
|
+
#### npx
|
|
24
|
+
|
|
22
25
|
```sh
|
|
23
26
|
npx create-wdio ./e2e
|
|
24
27
|
```
|
|
25
28
|
|
|
26
|
-
_
|
|
29
|
+
_[`npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) is a package runner tool that comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f)_
|
|
30
|
+
|
|
31
|
+
#### npm
|
|
27
32
|
|
|
28
33
|
```sh
|
|
29
34
|
npm init wdio ./e2e
|
|
30
35
|
```
|
|
31
36
|
|
|
32
|
-
_`npm init <initializer>` is available in npm 6+_
|
|
37
|
+
_[`npm init <initializer>`](https://docs.npmjs.com/cli/v7/commands/npm-init) is available in npm 6+_
|
|
38
|
+
|
|
39
|
+
#### yarn
|
|
33
40
|
|
|
34
41
|
```sh
|
|
35
42
|
yarn create wdio ./e2e
|
|
@@ -37,9 +44,11 @@ yarn create wdio ./e2e
|
|
|
37
44
|
|
|
38
45
|
_[`yarn create <starter-kit-package>`](https://yarnpkg.com/lang/en/docs/cli/create/) is available in Yarn 0.25+_
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
|
|
48
|
+
It will create a directory called `e2e` inside the current folder.
|
|
41
49
|
Then it will run the configuration wizard that will help you setup your framework.
|
|
42
50
|
|
|
51
|
+
|
|
43
52
|
## Supported Options
|
|
44
53
|
|
|
45
54
|
You can pass the following command line flags to modify the bootstrap mechanism:
|
package/build/index.js
CHANGED
|
@@ -71,6 +71,15 @@ async function createWebdriverIO(opts) {
|
|
|
71
71
|
process.exit(1);
|
|
72
72
|
}
|
|
73
73
|
console.log(`\nCreating WebdriverIO project in ${chalk_1.default.bold(root)}\n`);
|
|
74
|
+
if (!await (0, utils_1.exists)(pkgJsonPath)) {
|
|
75
|
+
console.log('package.json file does not exist in current dir, creating it...');
|
|
76
|
+
const pkgJson = {
|
|
77
|
+
name: 'webdriverio-tests',
|
|
78
|
+
version: '0.1.0',
|
|
79
|
+
private: true
|
|
80
|
+
};
|
|
81
|
+
await fs_1.default.promises.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 4));
|
|
82
|
+
}
|
|
74
83
|
const deps = ['@wdio/cli'];
|
|
75
84
|
await install(deps.flat(), root, opts);
|
|
76
85
|
console.log('\nFinished installing packages.');
|
|
@@ -79,11 +88,11 @@ async function createWebdriverIO(opts) {
|
|
|
79
88
|
if (await (0, utils_1.exists)(pkgJsonPath)) {
|
|
80
89
|
console.log('Adding scripts to package.json');
|
|
81
90
|
const pkgJson = require(pkgJsonPath);
|
|
82
|
-
const isUsingTypescript = await (0, utils_1.exists)('wdio.conf.ts');
|
|
91
|
+
const isUsingTypescript = await (0, utils_1.exists)('test/wdio.conf.ts');
|
|
83
92
|
if (!pkgJson.scripts) {
|
|
84
93
|
pkgJson.scripts = {};
|
|
85
94
|
}
|
|
86
|
-
pkgJson.scripts['wdio'] = `wdio run
|
|
95
|
+
pkgJson.scripts['wdio'] = `wdio run ${isUsingTypescript ? 'test/wdio.conf.ts' : 'wdio.conf.js'}`;
|
|
87
96
|
await fs_1.default.promises.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 4));
|
|
88
97
|
}
|
|
89
98
|
console.log(`\nš¤ Successfully setup project at ${root} š`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-wdio",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "Install WebdriverIO with all its dependencies in a single run",
|
|
5
5
|
"author": "Christian Bromann <christian@saucelabs.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@schemastore/package": "^0.0.6",
|
|
41
41
|
"@types/cross-spawn": "^6.0.2",
|
|
42
42
|
"@types/jest": "^27.0.2",
|
|
43
|
-
"@types/node": "^
|
|
43
|
+
"@types/node": "^17.0.7",
|
|
44
44
|
"@types/semver": "^7.3.8",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
46
46
|
"@typescript-eslint/parser": "^5.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"chalk": "^4.1.2",
|
|
58
|
-
"commander": "^
|
|
58
|
+
"commander": "^9.0.0",
|
|
59
59
|
"cross-spawn": "^7.0.3",
|
|
60
60
|
"semver": "^7.3.5"
|
|
61
61
|
}
|