@wdio/cli 8.0.0-alpha.607 → 8.0.0-alpha.620
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/interface.d.ts.map +1 -1
- package/build/interface.js +0 -2
- package/build/watcher.d.ts +1 -5
- package/build/watcher.d.ts.map +1 -1
- package/build/watcher.js +21 -17
- package/package.json +9 -9
package/build/interface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,OAAO,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAEjE,OAAO,EAAiB,SAAS,EAAE,MAAM,YAAY,CAAA;AAKrD,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,UAAU,iBAAiB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,GAAG,CAAA;IACb,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,KAAK,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IAyBjD,OAAO,CAAC,OAAO;IACR,cAAc,EAAE,MAAM;IAC7B,OAAO,CAAC,YAAY;IA1BjB,cAAc,EAAE,OAAO,CAAA;IACvB,MAAM;;;;;MAKZ;IAED,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,qBAAqB,CAAQ;IAErC,OAAO,CAAC,aAAa,CAAI;IAC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itter {
|
|
|
168
168
|
* event handler that is triggered when runner sends up events
|
|
169
169
|
*/
|
|
170
170
|
onMessage(event) {
|
|
171
|
-
// let a = true
|
|
172
|
-
// if (a) return
|
|
173
171
|
if (event.name === 'reporterRealTime') {
|
|
174
172
|
this.log(event.content);
|
|
175
173
|
return;
|
package/build/watcher.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Workers } from '@wdio/types';
|
|
2
2
|
import type { RunCommandArguments, ValueKeyIteratee } from './types';
|
|
3
|
-
type Spec = string | string[];
|
|
4
3
|
export default class Watcher {
|
|
5
4
|
private _configFile;
|
|
6
5
|
private _args;
|
|
@@ -25,10 +24,7 @@ export default class Watcher {
|
|
|
25
24
|
* run workers with params
|
|
26
25
|
* @param params parameters to run the worker with
|
|
27
26
|
*/
|
|
28
|
-
run(params?:
|
|
29
|
-
spec?: Spec;
|
|
30
|
-
}): void;
|
|
27
|
+
run(params?: Partial<RunCommandArguments>): void;
|
|
31
28
|
cleanUp(): void;
|
|
32
29
|
}
|
|
33
|
-
export {};
|
|
34
30
|
//# sourceMappingURL=watcher.d.ts.map
|
package/build/watcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAGxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAKpE,MAAM,CAAC,OAAO,OAAO,OAAO;IAKpB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,KAAK;IALjB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,MAAM,CAAa;gBAGf,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAMpD,KAAK;IAiDX;;;;OAIG;IACH,eAAe,CAAE,UAAU,UAAO,UAChB,MAAM;IAgCxB;;;;;OAKG;IACH,UAAU,CAAE,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU;IAqB7H;;;OAGG;IACH,GAAG,CAAE,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM;IAoC9C,OAAO;CAGV"}
|
package/build/watcher.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import url from 'node:url';
|
|
1
2
|
import chokidar from 'chokidar';
|
|
2
3
|
import logger from '@wdio/logger';
|
|
3
4
|
import pickBy from 'lodash.pickby';
|
|
@@ -9,21 +10,24 @@ export default class Watcher {
|
|
|
9
10
|
_configFile;
|
|
10
11
|
_args;
|
|
11
12
|
_launcher;
|
|
12
|
-
_specs;
|
|
13
|
+
_specs = [];
|
|
13
14
|
constructor(_configFile, _args) {
|
|
14
15
|
this._configFile = _configFile;
|
|
15
16
|
this._args = _args;
|
|
16
17
|
log.info('Starting launcher in watch mode');
|
|
17
18
|
this._launcher = new Launcher(this._configFile, this._args, true);
|
|
18
|
-
const specs = this._launcher.configParser.getSpecs();
|
|
19
|
-
const capSpecs = this._launcher.isMultiremote ? [] : union(flattenDeep(this._launcher.configParser.getCapabilities().map(cap => cap.specs || [])));
|
|
20
|
-
this._specs = [...specs, ...capSpecs];
|
|
21
19
|
}
|
|
22
20
|
async watch() {
|
|
21
|
+
await this._launcher.configParser.initialize();
|
|
22
|
+
const specs = this._launcher.configParser.getSpecs();
|
|
23
|
+
const capSpecs = this._launcher.isMultiremote
|
|
24
|
+
? []
|
|
25
|
+
: union(flattenDeep(this._launcher.configParser.getCapabilities().map(cap => cap.specs || [])));
|
|
26
|
+
this._specs = [...specs, ...capSpecs];
|
|
23
27
|
/**
|
|
24
28
|
* listen on spec changes and rerun specific spec file
|
|
25
29
|
*/
|
|
26
|
-
|
|
30
|
+
const flattenedSpecs = flattenDeep(this._specs).map((fileUrl) => url.fileURLToPath(fileUrl));
|
|
27
31
|
chokidar.watch(flattenedSpecs, { ignoreInitial: true })
|
|
28
32
|
.on('add', this.getFileListener())
|
|
29
33
|
.on('change', this.getFileListener());
|
|
@@ -77,13 +81,16 @@ export default class Watcher {
|
|
|
77
81
|
// If the runSpecs array is empty, then this must be a new file/array
|
|
78
82
|
// so add the spec directly to the runSpecs
|
|
79
83
|
if (runSpecs.length === 0) {
|
|
80
|
-
runSpecs.push(spec);
|
|
84
|
+
runSpecs.push(url.pathToFileURL(spec).href);
|
|
81
85
|
}
|
|
82
86
|
// Do not pass the `spec` command line option to `this.run()`
|
|
83
87
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
84
|
-
const { spec:
|
|
88
|
+
const { spec: _, ...args } = this._args;
|
|
85
89
|
return runSpecs.map((spec) => {
|
|
86
|
-
return this.run({
|
|
90
|
+
return this.run({
|
|
91
|
+
...args,
|
|
92
|
+
...(passOnFile ? { spec: [spec] } : {})
|
|
93
|
+
});
|
|
87
94
|
});
|
|
88
95
|
};
|
|
89
96
|
}
|
|
@@ -114,12 +121,9 @@ export default class Watcher {
|
|
|
114
121
|
* @param params parameters to run the worker with
|
|
115
122
|
*/
|
|
116
123
|
run(params = {}) {
|
|
117
|
-
const workers = this.getWorkers((params.spec
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
return worker.specs.includes(params.spec);
|
|
122
|
-
} : undefined));
|
|
124
|
+
const workers = this.getWorkers((params.spec
|
|
125
|
+
? (worker) => Boolean(worker.specs.find((s) => params.spec?.includes(s)))
|
|
126
|
+
: undefined));
|
|
123
127
|
/**
|
|
124
128
|
* don't do anything if no worker was found
|
|
125
129
|
*/
|
|
@@ -139,10 +143,10 @@ export default class Watcher {
|
|
|
139
143
|
* trigger new run for non busy worker
|
|
140
144
|
*/
|
|
141
145
|
for (const [, worker] of Object.entries(workers)) {
|
|
142
|
-
const { cid,
|
|
143
|
-
const args = Object.assign({ sessionId }, params);
|
|
146
|
+
const { cid, capabilities, specs, sessionId } = worker;
|
|
147
|
+
const args = Object.assign({ sessionId, baseUrl: worker.config.baseUrl }, params);
|
|
144
148
|
worker.postMessage('run', args);
|
|
145
|
-
this._launcher.interface.emit('job:start', { cid, caps, specs });
|
|
149
|
+
this._launcher.interface.emit('job:start', { cid, caps: capabilities, specs });
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
152
|
cleanUp() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cli",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.620+56a4ae1f2",
|
|
4
4
|
"description": "WebdriverIO testrunner command line interface",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cli",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@types/lodash.union": "^4.6.7",
|
|
41
41
|
"@types/recursive-readdir": "^2.2.1",
|
|
42
42
|
"@types/yargs": "^17.0.10",
|
|
43
|
-
"@wdio/config": "8.0.0-alpha.
|
|
44
|
-
"@wdio/globals": "8.0.0-alpha.
|
|
45
|
-
"@wdio/logger": "8.0.0-alpha.
|
|
46
|
-
"@wdio/protocols": "8.0.0-alpha.
|
|
47
|
-
"@wdio/types": "8.0.0-alpha.
|
|
48
|
-
"@wdio/utils": "8.0.0-alpha.
|
|
43
|
+
"@wdio/config": "8.0.0-alpha.620+56a4ae1f2",
|
|
44
|
+
"@wdio/globals": "8.0.0-alpha.620+56a4ae1f2",
|
|
45
|
+
"@wdio/logger": "8.0.0-alpha.620+56a4ae1f2",
|
|
46
|
+
"@wdio/protocols": "8.0.0-alpha.620+56a4ae1f2",
|
|
47
|
+
"@wdio/types": "8.0.0-alpha.620+56a4ae1f2",
|
|
48
|
+
"@wdio/utils": "8.0.0-alpha.620+56a4ae1f2",
|
|
49
49
|
"async-exit-hook": "^2.0.1",
|
|
50
50
|
"chalk": "^5.0.1",
|
|
51
51
|
"chokidar": "^3.5.3",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"mkdirp": "^1.0.4",
|
|
60
60
|
"read-pkg-up": "9.1.0",
|
|
61
61
|
"recursive-readdir": "^2.2.2",
|
|
62
|
-
"webdriverio": "8.0.0-alpha.
|
|
62
|
+
"webdriverio": "8.0.0-alpha.620+56a4ae1f2",
|
|
63
63
|
"yargs": "^17.5.1",
|
|
64
64
|
"yarn-install": "^1.0.0"
|
|
65
65
|
},
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "^18.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "56a4ae1f236fc71721e15c077cdc35964093bbe4"
|
|
73
73
|
}
|