@wdio/cli 8.18.0 → 8.19.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.
- package/build/commands/repl.d.ts +6 -0
- package/build/commands/repl.d.ts.map +1 -1
- package/build/commands/run.d.ts +15 -1
- package/build/commands/run.d.ts.map +1 -1
- package/build/commands/run.js +11 -0
- package/build/constants.d.ts +3 -0
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +260 -0
- package/build/interface.d.ts +1 -0
- package/build/interface.d.ts.map +1 -1
- package/build/interface.js +10 -2
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +8 -1
- package/build/types.d.ts +1 -0
- package/build/types.d.ts.map +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +71 -63
- package/package.json +7 -7
package/build/commands/repl.d.ts
CHANGED
|
@@ -86,6 +86,12 @@ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, str
|
|
|
86
86
|
readonly desc: "Auto compilation options";
|
|
87
87
|
} | {
|
|
88
88
|
readonly desc: "Enable coverage for browser runner";
|
|
89
|
+
} | {
|
|
90
|
+
readonly desc: "Shard tests and execute only the selected shard. Specify in the one-based form like `--shard x/y`, where x is the current and y the total shard.";
|
|
91
|
+
readonly coerce: (shard: string) => {
|
|
92
|
+
current: number;
|
|
93
|
+
total: number;
|
|
94
|
+
};
|
|
89
95
|
}>>>;
|
|
90
96
|
export declare const handler: (argv: ReplCommandArguments) => Promise<void>;
|
|
91
97
|
//# sourceMappingURL=repl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/commands/repl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAK1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAOvD,eAAO,MAAM,OAAO,iCAAiC,CAAA;AACrD,eAAO,MAAM,IAAI,0CAA0C,CAAA;AAC3D,eAAO,MAAM,OAAO,EAAE;KAAG,CAAC,IAAI,MAAM,oBAAoB,CAAC,CAAC,EAAE,OAAO;CAgBzD,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI
|
|
1
|
+
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/commands/repl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAK1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAOvD,eAAO,MAAM,OAAO,iCAAiC,CAAA;AACrD,eAAO,MAAM,IAAI,0CAA0C,CAAA;AAC3D,eAAO,MAAM,OAAO,EAAE;KAAG,CAAC,IAAI,MAAM,oBAAoB,CAAC,CAAC,EAAE,OAAO;CAgBzD,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYlC,CAAA;AAED,eAAO,MAAM,OAAO,SAAgB,oBAAoB,kBAUvD,CAAA"}
|
package/build/commands/run.d.ts
CHANGED
|
@@ -105,8 +105,15 @@ export declare const cmdArgs: {
|
|
|
105
105
|
readonly coverage: {
|
|
106
106
|
readonly desc: "Enable coverage for browser runner";
|
|
107
107
|
};
|
|
108
|
+
readonly shard: {
|
|
109
|
+
readonly desc: "Shard tests and execute only the selected shard. Specify in the one-based form like `--shard x/y`, where x is the current and y the total shard.";
|
|
110
|
+
readonly coerce: (shard: string) => {
|
|
111
|
+
current: number;
|
|
112
|
+
total: number;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
108
115
|
};
|
|
109
|
-
export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "framework" | "reporters" | "hostname" | "port" | "path" | "baseUrl" | "exclude" | "user" | "key" | "logLevel" | "spec" | "waitforTimeout" | "
|
|
116
|
+
export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "framework" | "reporters" | "hostname" | "port" | "path" | "baseUrl" | "exclude" | "user" | "key" | "logLevel" | "spec" | "waitforTimeout" | "bail" | "watch" | "shard" | "mochaOpts" | "jasmineOpts" | "cucumberOpts" | "autoCompileOpts" | "coverage" | "suite" | "multi-run"> & import("yargs").InferredOptionTypes<{
|
|
110
117
|
readonly watch: {
|
|
111
118
|
readonly desc: "Run WebdriverIO in watch mode";
|
|
112
119
|
readonly type: "boolean";
|
|
@@ -209,6 +216,13 @@ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "fr
|
|
|
209
216
|
readonly coverage: {
|
|
210
217
|
readonly desc: "Enable coverage for browser runner";
|
|
211
218
|
};
|
|
219
|
+
readonly shard: {
|
|
220
|
+
readonly desc: "Shard tests and execute only the selected shard. Specify in the one-based form like `--shard x/y`, where x is the current and y the total shard.";
|
|
221
|
+
readonly coerce: (shard: string) => {
|
|
222
|
+
current: number;
|
|
223
|
+
total: number;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
212
226
|
}>>;
|
|
213
227
|
export declare function launchWithStdin(wdioConfPath: string, params: Partial<RunCommandArguments>): void;
|
|
214
228
|
export declare function launch(wdioConfPath: string, params: Partial<RunCommandArguments>): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,eAAO,MAAM,OAAO,qBAAqB,CAAA;AAEzC,eAAO,MAAM,IAAI,yEAAyE,CAAA;AAa1F,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,eAAO,MAAM,OAAO,qBAAqB,CAAA;AAEzC,eAAO,MAAM,IAAI,yEAAyE,CAAA;AAa1F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA6FI,MAAM;;;;;CAQpB,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAVX,MAAM;;;;;GAqB7B,CAAA;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAczF;AAED,wBAAsB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,iBAgBtF;AAMD,wBAAsB,OAAO,CAAC,IAAI,EAAE,mBAAmB,yBAqFtD"}
|
package/build/commands/run.js
CHANGED
|
@@ -108,6 +108,16 @@ export const cmdArgs = {
|
|
|
108
108
|
},
|
|
109
109
|
coverage: {
|
|
110
110
|
desc: 'Enable coverage for browser runner'
|
|
111
|
+
},
|
|
112
|
+
shard: {
|
|
113
|
+
desc: 'Shard tests and execute only the selected shard. Specify in the one-based form like `--shard x/y`, where x is the current and y the total shard.',
|
|
114
|
+
coerce: (shard) => {
|
|
115
|
+
const [current, total] = shard.split('/').map(Number);
|
|
116
|
+
if (Number.isNaN(current) || Number.isNaN(total)) {
|
|
117
|
+
throw new Error('Shard parameter must be in the form `x/y`, where x and y are positive integers.');
|
|
118
|
+
}
|
|
119
|
+
return { current, total };
|
|
120
|
+
}
|
|
111
121
|
}
|
|
112
122
|
};
|
|
113
123
|
export const builder = (yargs) => {
|
|
@@ -115,6 +125,7 @@ export const builder = (yargs) => {
|
|
|
115
125
|
.options(cmdArgs)
|
|
116
126
|
.example('$0 run wdio.conf.js --suite foobar', 'Run suite on testsuite "foobar"')
|
|
117
127
|
.example('$0 run wdio.conf.js --spec ./tests/e2e/a.js --spec ./tests/e2e/b.js', 'Run suite on specific specs')
|
|
128
|
+
.example('$0 run wdio.conf.js --shard 1/4', 'Run only the first shard of 4 shards')
|
|
118
129
|
.example('$0 run wdio.conf.js --mochaOpts.timeout 60000', 'Run suite with custom Mocha timeout')
|
|
119
130
|
.example('$0 run wdio.conf.js --autoCompileOpts.autoCompile=false', 'Disable auto-loading of ts-node or @babel/register')
|
|
120
131
|
.example('$0 run wdio.conf.js --autoCompileOpts.tsNodeOpts.project=./configs/bdd-tsconfig.json', 'Run suite with ts-node using custom tsconfig.json')
|
package/build/constants.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Options } from '@wdio/types';
|
|
1
2
|
import type { Questionnair } from './types.js';
|
|
2
3
|
export declare const pkg: any;
|
|
3
4
|
export declare const CLI_EPILOGUE: string;
|
|
@@ -255,5 +256,7 @@ export declare const QUESTIONNAIRE: ({
|
|
|
255
256
|
choices?: undefined;
|
|
256
257
|
when?: undefined;
|
|
257
258
|
})[];
|
|
259
|
+
export declare const COMMUNITY_PACKAGES_WITH_TS_SUPPORT: string[];
|
|
260
|
+
export declare const TESTRUNNER_DEFAULTS: Options.Definition<Options.Testrunner>;
|
|
258
261
|
export {};
|
|
259
262
|
//# sourceMappingURL=constants.d.ts.map
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/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,gBAAgB;;;GAG5B,CAAA;AAED,eAAO,MAAM,mBAAmB;;;GAG/B,CAAA;AAED,eAAO,MAAM,oBAAoB;;;GAKhC,CAAA;AAED,iBAAS,eAAe,CAAE,OAAO,EAAE,YAAY,WAE9C;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,YAAY,WAElD;AAMD,eAAO,MAAM,aAAa,SAYzB,CAAA;AAqBD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkBqB,YAAY;;;;;;;oBAYX,YAAY;;;;;;;oBAWZ,YAAY;;;;;;;;;;;oBAOb,YAAY;;;;;;;;;;oBAgBX,YAAY;;;;;oBAQb,YAAY;;;;;;;;oBAMZ,YAAY;;;;;;;;oBAyBZ,YAAY;;;;;;oBAoDZ,YAAY;;;;;;;oBASZ,YAAY;;;;;;uBA0BR,YAAY;;;;;;;;;;uBAaxC,YAAY;uBASe,YAAY;;;;;;uBAmBZ,YAAY;oBAIf,YAAY;;;;;;uBAuCT,YAAY;oBAKf,YAAY;;;;;;;;;;;;;;;;uBAiCpC,YAAY;;;;uBAuBZ,YAAY;;;;;;;;;IA2DjC,CAAA;AAEF,eAAO,MAAM,kCAAkC,UAM9C,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CA+QtE,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
|
+
import { HOOK_DEFINITION } from '@wdio/utils';
|
|
4
5
|
import { detectCompiler, getDefaultFiles, convertPackageHashToObject, getProjectProps, getProjectRoot, } from './utils.js';
|
|
5
6
|
const require = createRequire(import.meta.url);
|
|
6
7
|
export const pkg = require('../package.json');
|
|
@@ -605,3 +606,262 @@ export const QUESTIONNAIRE = [{
|
|
|
605
606
|
message: 'Do you want me to run `npm install`',
|
|
606
607
|
default: true
|
|
607
608
|
}];
|
|
609
|
+
export const COMMUNITY_PACKAGES_WITH_TS_SUPPORT = [
|
|
610
|
+
'wdio-electron-service',
|
|
611
|
+
'wdio-vscode-service',
|
|
612
|
+
'wdio-nuxt-service',
|
|
613
|
+
'wdio-vite-service',
|
|
614
|
+
'wdio-gmail-service'
|
|
615
|
+
];
|
|
616
|
+
export const TESTRUNNER_DEFAULTS = {
|
|
617
|
+
/**
|
|
618
|
+
* Define specs for test execution. You can either specify a glob
|
|
619
|
+
* pattern to match multiple files at once or wrap a glob or set of
|
|
620
|
+
* paths into an array to run them within a single worker process.
|
|
621
|
+
*/
|
|
622
|
+
specs: {
|
|
623
|
+
type: 'object',
|
|
624
|
+
validate: (param) => {
|
|
625
|
+
if (!Array.isArray(param)) {
|
|
626
|
+
throw new Error('the "specs" option needs to be a list of strings');
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
/**
|
|
631
|
+
* exclude specs from test execution
|
|
632
|
+
*/
|
|
633
|
+
exclude: {
|
|
634
|
+
type: 'object',
|
|
635
|
+
validate: (param) => {
|
|
636
|
+
if (!Array.isArray(param)) {
|
|
637
|
+
throw new Error('the "exclude" option needs to be a list of strings');
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
/**
|
|
642
|
+
* key/value definition of suites (named by key) and a list of specs as value
|
|
643
|
+
* to specify a specific set of tests to execute
|
|
644
|
+
*/
|
|
645
|
+
suites: {
|
|
646
|
+
type: 'object'
|
|
647
|
+
},
|
|
648
|
+
/**
|
|
649
|
+
* Project root directory path.
|
|
650
|
+
*/
|
|
651
|
+
rootDir: {
|
|
652
|
+
type: 'string'
|
|
653
|
+
},
|
|
654
|
+
/**
|
|
655
|
+
* If you only want to run your tests until a specific amount of tests have failed use
|
|
656
|
+
* bail (default is 0 - don't bail, run all tests).
|
|
657
|
+
*/
|
|
658
|
+
bail: {
|
|
659
|
+
type: 'number',
|
|
660
|
+
default: 0
|
|
661
|
+
},
|
|
662
|
+
/**
|
|
663
|
+
* supported test framework by wdio testrunner
|
|
664
|
+
*/
|
|
665
|
+
framework: {
|
|
666
|
+
type: 'string'
|
|
667
|
+
},
|
|
668
|
+
/**
|
|
669
|
+
* capabilities of WebDriver sessions
|
|
670
|
+
*/
|
|
671
|
+
capabilities: {
|
|
672
|
+
type: 'object',
|
|
673
|
+
validate: (param) => {
|
|
674
|
+
/**
|
|
675
|
+
* should be an object
|
|
676
|
+
*/
|
|
677
|
+
if (!Array.isArray(param)) {
|
|
678
|
+
if (typeof param === 'object') {
|
|
679
|
+
return true;
|
|
680
|
+
}
|
|
681
|
+
throw new Error('the "capabilities" options needs to be an object or a list of objects');
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* or an array of objects
|
|
685
|
+
*/
|
|
686
|
+
for (const option of param) {
|
|
687
|
+
if (typeof option === 'object') { // Check does not work recursively
|
|
688
|
+
continue;
|
|
689
|
+
}
|
|
690
|
+
throw new Error('expected every item of a list of capabilities to be of type object');
|
|
691
|
+
}
|
|
692
|
+
return true;
|
|
693
|
+
},
|
|
694
|
+
required: true
|
|
695
|
+
},
|
|
696
|
+
/**
|
|
697
|
+
* list of reporters to use, a reporter can be either a string or an object with
|
|
698
|
+
* reporter options, e.g.:
|
|
699
|
+
* [
|
|
700
|
+
* 'dot',
|
|
701
|
+
* {
|
|
702
|
+
* name: 'spec',
|
|
703
|
+
* outputDir: __dirname + '/reports'
|
|
704
|
+
* }
|
|
705
|
+
* ]
|
|
706
|
+
*/
|
|
707
|
+
reporters: {
|
|
708
|
+
type: 'object',
|
|
709
|
+
validate: (param) => {
|
|
710
|
+
/**
|
|
711
|
+
* option must be an array
|
|
712
|
+
*/
|
|
713
|
+
if (!Array.isArray(param)) {
|
|
714
|
+
throw new Error('the "reporters" options needs to be a list of strings');
|
|
715
|
+
}
|
|
716
|
+
const isValidReporter = (option) => ((typeof option === 'string') ||
|
|
717
|
+
(typeof option === 'function'));
|
|
718
|
+
/**
|
|
719
|
+
* array elements must be:
|
|
720
|
+
*/
|
|
721
|
+
for (const option of param) {
|
|
722
|
+
/**
|
|
723
|
+
* either a string or a function (custom reporter)
|
|
724
|
+
*/
|
|
725
|
+
if (isValidReporter(option)) {
|
|
726
|
+
continue;
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* or an array with the name of the reporter as first element and the options
|
|
730
|
+
* as second element
|
|
731
|
+
*/
|
|
732
|
+
if (Array.isArray(option) &&
|
|
733
|
+
typeof option[1] === 'object' &&
|
|
734
|
+
isValidReporter(option[0])) {
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
throw new Error('a reporter should be either a string in the format "wdio-<reportername>-reporter" ' +
|
|
738
|
+
'or a function/class. Please see the docs for more information on custom reporters ' +
|
|
739
|
+
'(https://webdriver.io/docs/customreporter)');
|
|
740
|
+
}
|
|
741
|
+
return true;
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
/**
|
|
745
|
+
* set of WDIO services to use
|
|
746
|
+
*/
|
|
747
|
+
services: {
|
|
748
|
+
type: 'object',
|
|
749
|
+
validate: (param) => {
|
|
750
|
+
/**
|
|
751
|
+
* should be an array
|
|
752
|
+
*/
|
|
753
|
+
if (!Array.isArray(param)) {
|
|
754
|
+
throw new Error('the "services" options needs to be a list of strings and/or arrays');
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* with arrays and/or strings
|
|
758
|
+
*/
|
|
759
|
+
for (const option of param) {
|
|
760
|
+
if (!Array.isArray(option)) {
|
|
761
|
+
if (typeof option === 'string') {
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
throw new Error('the "services" options needs to be a list of strings and/or arrays');
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return true;
|
|
768
|
+
},
|
|
769
|
+
default: []
|
|
770
|
+
},
|
|
771
|
+
/**
|
|
772
|
+
* Node arguments to specify when launching child processes
|
|
773
|
+
*/
|
|
774
|
+
execArgv: {
|
|
775
|
+
type: 'object',
|
|
776
|
+
validate: (param) => {
|
|
777
|
+
if (!Array.isArray(param)) {
|
|
778
|
+
throw new Error('the "execArgv" options needs to be a list of strings');
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
default: []
|
|
782
|
+
},
|
|
783
|
+
/**
|
|
784
|
+
* amount of instances to be allowed to run in total
|
|
785
|
+
*/
|
|
786
|
+
maxInstances: {
|
|
787
|
+
type: 'number'
|
|
788
|
+
},
|
|
789
|
+
/**
|
|
790
|
+
* amount of instances to be allowed to run per capability
|
|
791
|
+
*/
|
|
792
|
+
maxInstancesPerCapability: {
|
|
793
|
+
type: 'number'
|
|
794
|
+
},
|
|
795
|
+
/**
|
|
796
|
+
* whether or not testrunner should inject `browser`, `$` and `$$` as
|
|
797
|
+
* global environment variables
|
|
798
|
+
*/
|
|
799
|
+
injectGlobals: {
|
|
800
|
+
type: 'boolean'
|
|
801
|
+
},
|
|
802
|
+
/**
|
|
803
|
+
* The number of times to retry the entire specfile when it fails as a whole
|
|
804
|
+
*/
|
|
805
|
+
specFileRetries: {
|
|
806
|
+
type: 'number',
|
|
807
|
+
default: 0
|
|
808
|
+
},
|
|
809
|
+
/**
|
|
810
|
+
* Delay in seconds between the spec file retry attempts
|
|
811
|
+
*/
|
|
812
|
+
specFileRetriesDelay: {
|
|
813
|
+
type: 'number',
|
|
814
|
+
default: 0
|
|
815
|
+
},
|
|
816
|
+
/**
|
|
817
|
+
* Whether or not retried spec files should be retried immediately or deferred to the end of the queue
|
|
818
|
+
*/
|
|
819
|
+
specFileRetriesDeferred: {
|
|
820
|
+
type: 'boolean',
|
|
821
|
+
default: true
|
|
822
|
+
},
|
|
823
|
+
/**
|
|
824
|
+
* list of strings to watch of `wdio` command is called with `--watch` flag
|
|
825
|
+
*/
|
|
826
|
+
filesToWatch: {
|
|
827
|
+
type: 'object',
|
|
828
|
+
validate: (param) => {
|
|
829
|
+
if (!Array.isArray(param)) {
|
|
830
|
+
throw new Error('the "filesToWatch" option needs to be a list of strings');
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
shard: {
|
|
835
|
+
type: 'object',
|
|
836
|
+
validate: (param) => {
|
|
837
|
+
if (typeof param !== 'object') {
|
|
838
|
+
throw new Error('the "shard" options needs to be an object');
|
|
839
|
+
}
|
|
840
|
+
const p = param;
|
|
841
|
+
if (typeof p.current !== 'number' || typeof p.total !== 'number') {
|
|
842
|
+
throw new Error('the "shard" option needs to have "current" and "total" properties with number values');
|
|
843
|
+
}
|
|
844
|
+
if (p.current < 0 || p.current > p.total) {
|
|
845
|
+
throw new Error('the "shard.current" value has to be between 0 and "shard.total"');
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
/**
|
|
850
|
+
* hooks
|
|
851
|
+
*/
|
|
852
|
+
onPrepare: HOOK_DEFINITION,
|
|
853
|
+
onWorkerStart: HOOK_DEFINITION,
|
|
854
|
+
onWorkerEnd: HOOK_DEFINITION,
|
|
855
|
+
before: HOOK_DEFINITION,
|
|
856
|
+
beforeSession: HOOK_DEFINITION,
|
|
857
|
+
beforeSuite: HOOK_DEFINITION,
|
|
858
|
+
beforeHook: HOOK_DEFINITION,
|
|
859
|
+
beforeTest: HOOK_DEFINITION,
|
|
860
|
+
afterTest: HOOK_DEFINITION,
|
|
861
|
+
afterHook: HOOK_DEFINITION,
|
|
862
|
+
afterSuite: HOOK_DEFINITION,
|
|
863
|
+
afterSession: HOOK_DEFINITION,
|
|
864
|
+
after: HOOK_DEFINITION,
|
|
865
|
+
onComplete: HOOK_DEFINITION,
|
|
866
|
+
onReload: HOOK_DEFINITION
|
|
867
|
+
};
|
package/build/interface.d.ts
CHANGED
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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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,KAAK,GAAG,SAAS;IAOtC;;OAEG;IACH,SAAS,CAAE,KAAK,EAAE,iBAAiB;IAiDnC,aAAa;IAgBb,cAAc;IAYd,YAAY;IAgBZ,QAAQ;CAIX"}
|
package/build/interface.js
CHANGED
|
@@ -49,6 +49,9 @@ export default class WDIOCLInterface extends EventEmitter {
|
|
|
49
49
|
this.setup();
|
|
50
50
|
this.onStart();
|
|
51
51
|
}
|
|
52
|
+
#hasShard() {
|
|
53
|
+
return this._config.shard && this._config.shard.total !== 1;
|
|
54
|
+
}
|
|
52
55
|
setup() {
|
|
53
56
|
this._jobs = new Map();
|
|
54
57
|
this._start = new Date();
|
|
@@ -68,7 +71,10 @@ export default class WDIOCLInterface extends EventEmitter {
|
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
73
|
onStart() {
|
|
71
|
-
|
|
74
|
+
const shardNote = this.#hasShard()
|
|
75
|
+
? ` (Shard ${this._config.shard.current} of ${this._config.shard.total})`
|
|
76
|
+
: '';
|
|
77
|
+
this.log(chalk.bold(`\nExecution of ${chalk.blue(this.totalWorkerCnt)} workers${shardNote} started at`), this._start.toISOString());
|
|
72
78
|
if (this._inDebugMode) {
|
|
73
79
|
this.log(chalk.bgYellow.black('DEBUG mode enabled!'));
|
|
74
80
|
}
|
|
@@ -243,7 +249,9 @@ export default class WDIOCLInterface extends EventEmitter {
|
|
|
243
249
|
const failed = this.result.failed ? chalk.red(this.result.failed, 'failed') + ', ' : '';
|
|
244
250
|
const skipped = this._skippedSpecs > 0 ? chalk.gray(this._skippedSpecs, 'skipped') + ', ' : '';
|
|
245
251
|
const percentCompleted = totalJobs ? Math.round(this.result.finished / totalJobs * 100) : 0;
|
|
246
|
-
return this.log('\nSpec Files:\t', chalk.green(this.result.passed, 'passed') + ', ' + retries + failed + skipped + totalJobs, 'total', `(${percentCompleted}% completed)`, 'in', elapsed,
|
|
252
|
+
return this.log('\nSpec Files:\t', chalk.green(this.result.passed, 'passed') + ', ' + retries + failed + skipped + totalJobs, 'total', `(${percentCompleted}% completed)`, 'in', elapsed, this.#hasShard()
|
|
253
|
+
? `\nShard:\t\t ${this._config.shard.current} / ${this._config.shard.total}`
|
|
254
|
+
: undefined, '\n');
|
|
247
255
|
}
|
|
248
256
|
finalise() {
|
|
249
257
|
this.printReporters();
|
package/build/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAkB,MAAM,cAAc,CAAA;AAE3D,OAAO,KAAK,EAAyB,QAAQ,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,WAAW,MAAM,gBAAgB,CAAA;AAIxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAkBrD,MAAM,WAAW,UAAU;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,cAAM,QAAQ;IAkBN,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,YAAY;IAnBjB,YAAY,EAAE,YAAY,CAAA;IAC1B,aAAa,UAAQ;IACrB,qBAAqB,UAAQ;IAC7B,MAAM,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAA;IAChC,SAAS,CAAC,EAAE,WAAW,CAAA;IAE9B,OAAO,CAAC,SAAS,CAAI;IACrB,OAAO,CAAC,wBAAwB,CAAQ;IACxC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,aAAa,CAAI;IAEzB,OAAO,CAAC,SAAS,CAAC,CAA4B;IAC9C,OAAO,CAAC,QAAQ,CAAC,CAAU;gBAGf,eAAe,EAAE,MAAM,EACvB,KAAK,GAAE,OAAO,CAAC,mBAAmB,CAAM,EACxC,YAAY,UAAQ;IAKhC;;;OAGG;IACG,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC;IAsHxC;;OAEG;IACH,OAAO,CAAC,QAAQ;IA+EhB;;OAEG;IACH,OAAO,CAAC,YAAY;IAepB;;;OAGG;IACH,OAAO,CAAC,SAAS;IAmEjB;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAIpC;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAI7B;;;;;;OAMG;YACW,cAAc;IA8F5B,OAAO,CAAC,gBAAgB;IAWxB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;;OAMG;YACW,WAAW;IA0DzB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAcpB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CAG7B;AAED,eAAe,QAAQ,CAAA"}
|
package/build/launcher.js
CHANGED
|
@@ -2,10 +2,11 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import exitHook from 'async-exit-hook';
|
|
4
4
|
import logger from '@wdio/logger';
|
|
5
|
-
import { ConfigParser } from '@wdio/config';
|
|
5
|
+
import { ConfigParser, validateConfig } from '@wdio/config';
|
|
6
6
|
import { initialisePlugin, initialiseLauncherService, sleep, setupDriver, setupBrowser } from '@wdio/utils';
|
|
7
7
|
import CLInterface from './interface.js';
|
|
8
8
|
import { runLauncherHook, runOnCompleteHook, runServiceHook } from './utils.js';
|
|
9
|
+
import { TESTRUNNER_DEFAULTS } from './constants.js';
|
|
9
10
|
const log = logger('@wdio/cli:launcher');
|
|
10
11
|
class Launcher {
|
|
11
12
|
_configFilePath;
|
|
@@ -46,6 +47,7 @@ class Launcher {
|
|
|
46
47
|
this.isParallelMultiremote = Array.isArray(capabilities) &&
|
|
47
48
|
capabilities.every(cap => Object.values(cap).length > 0 && Object.values(cap).every(c => typeof c === 'object' && c.capabilities));
|
|
48
49
|
this.isMultiremote = this.isParallelMultiremote || !Array.isArray(capabilities);
|
|
50
|
+
validateConfig(TESTRUNNER_DEFAULTS, { ...config, capabilities });
|
|
49
51
|
if (config.outputDir) {
|
|
50
52
|
await fs.mkdir(path.join(config.outputDir), { recursive: true });
|
|
51
53
|
process.env.WDIO_LOG_PATH = path.join(config.outputDir, 'wdio.log');
|
|
@@ -192,6 +194,11 @@ class Launcher {
|
|
|
192
194
|
* fail if no specs were found or specified
|
|
193
195
|
*/
|
|
194
196
|
if (Object.values(this._schedule).reduce((specCnt, schedule) => specCnt + schedule.specs.length, 0) === 0) {
|
|
197
|
+
const { total, current } = config.shard;
|
|
198
|
+
if (total > 1) {
|
|
199
|
+
log.info(`No specs to execute in shard ${current}/${total}, exiting!`);
|
|
200
|
+
return resolve(0);
|
|
201
|
+
}
|
|
195
202
|
log.error('No specs found to run, exiting with failure');
|
|
196
203
|
return resolve(1);
|
|
197
204
|
}
|
package/build/types.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export interface RunCommandArguments {
|
|
|
79
79
|
logLevel?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
80
80
|
bail?: number;
|
|
81
81
|
baseUrl?: string;
|
|
82
|
+
shard?: Options.ShardOptions;
|
|
82
83
|
waitforTimeout?: number;
|
|
83
84
|
framework?: string;
|
|
84
85
|
reporters?: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AAO,CAAC,GACpC,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAC3B,KAAK,iBAAiB,CAAC,CAAC,IAClB,YAAY,GACZ,CAAC,YAAY,EAAE,GAAG,CAAC,GACnB,cAAc,CAAC,CAAC,CAAC,CAAC;AACxB,KAAK,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7C,KAAK,cAAc,CAAC,CAAC,IAAI;KACpB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;CACvD,CAAC;AACF,KAAK,OAAO,GAAG,OAAO,CAAC;AAEvB,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,OAAO,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,qBAAqB,CAAA;CACrC"}
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAatD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,EAEH,eAAe,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAatD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,EAEH,eAAe,EAQlB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAC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H,wBAAsB,iBAAiB,CAAC,aAAa,EAAE,aAAa,8BAgCnE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QA0FxF;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,aAAa,EAAE,aAAa,iBAwGjE;AAOD;;GAEG;AACH,wBAAsB,UAAU,CAAC,aAAa,EAAE,aAAa,iBA4C5D;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,iBAmBlE;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,oBAqClE;AAED,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,aAAa,4DAoBpE"}
|
package/build/utils.js
CHANGED
|
@@ -16,7 +16,7 @@ import { resolve } from 'import-meta-resolve';
|
|
|
16
16
|
import { SevereServiceError } from 'webdriverio';
|
|
17
17
|
import { ConfigParser } from '@wdio/config';
|
|
18
18
|
import { CAPABILITY_KEYS } from '@wdio/protocols';
|
|
19
|
-
import { ANDROID_CONFIG, CompilerOptions, DEPENDENCIES_INSTALLATION_MESSAGE, IOS_CONFIG, pkg, QUESTIONNAIRE, TESTING_LIBRARY_PACKAGES, usesSerenity, } from './constants.js';
|
|
19
|
+
import { ANDROID_CONFIG, CompilerOptions, DEPENDENCIES_INSTALLATION_MESSAGE, IOS_CONFIG, pkg, QUESTIONNAIRE, TESTING_LIBRARY_PACKAGES, COMMUNITY_PACKAGES_WITH_TS_SUPPORT, usesSerenity, } from './constants.js';
|
|
20
20
|
import { EjsHelpers } from './templates/EjsHelpers.js';
|
|
21
21
|
const log = logger('@wdio/cli:utils');
|
|
22
22
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
@@ -691,7 +691,11 @@ export function npmInstall(parsedAnswers, useYarn, npmTag) {
|
|
|
691
691
|
* add ts-node if TypeScript is desired but not installed
|
|
692
692
|
*/
|
|
693
693
|
export async function setupTypeScript(parsedAnswers) {
|
|
694
|
-
|
|
694
|
+
/**
|
|
695
|
+
* don't create a `tsconfig.json` if user doesn't want to use TypeScript
|
|
696
|
+
* or if a `tsconfig.json` already exists
|
|
697
|
+
*/
|
|
698
|
+
if (!parsedAnswers.isUsingTypeScript || parsedAnswers.hasRootTSConfig) {
|
|
695
699
|
return;
|
|
696
700
|
}
|
|
697
701
|
console.log('Setting up TypeScript...');
|
|
@@ -707,70 +711,74 @@ export async function setupTypeScript(parsedAnswers) {
|
|
|
707
711
|
...(parsedAnswers.runner === 'browser' ? ['@wdio/browser-runner'] : []),
|
|
708
712
|
...servicePackages
|
|
709
713
|
.map(service => service.package)
|
|
714
|
+
.filter(service => (
|
|
715
|
+
/**
|
|
716
|
+
* given that we know that all "official" services have
|
|
717
|
+
* typescript support we only include them
|
|
718
|
+
*/
|
|
719
|
+
service.startsWith('@wdio') ||
|
|
710
720
|
/**
|
|
711
|
-
*
|
|
712
|
-
*
|
|
721
|
+
* also include community maintained packages with known
|
|
722
|
+
* support for TypeScript
|
|
713
723
|
*/
|
|
714
|
-
.
|
|
724
|
+
COMMUNITY_PACKAGES_WITH_TS_SUPPORT.includes(service)))
|
|
715
725
|
];
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
await fs.writeFile(parsedAnswers.tsConfigFilePath, JSON.stringify(config, null, 4));
|
|
773
|
-
}
|
|
726
|
+
const preset = getPreset(parsedAnswers);
|
|
727
|
+
const config = {
|
|
728
|
+
compilerOptions: {
|
|
729
|
+
// compiler
|
|
730
|
+
moduleResolution: 'node',
|
|
731
|
+
module: !parsedAnswers.esmSupport ? 'commonjs' : 'ESNext',
|
|
732
|
+
target: 'es2022',
|
|
733
|
+
lib: ['es2022', 'dom'],
|
|
734
|
+
types,
|
|
735
|
+
skipLibCheck: true,
|
|
736
|
+
// bundler
|
|
737
|
+
noEmit: true,
|
|
738
|
+
allowImportingTsExtensions: true,
|
|
739
|
+
resolveJsonModule: true,
|
|
740
|
+
isolatedModules: true,
|
|
741
|
+
// linting
|
|
742
|
+
strict: true,
|
|
743
|
+
noUnusedLocals: true,
|
|
744
|
+
noUnusedParameters: true,
|
|
745
|
+
noFallthroughCasesInSwitch: true,
|
|
746
|
+
...Object.assign(preset === 'lit'
|
|
747
|
+
? {
|
|
748
|
+
experimentalDecorators: true,
|
|
749
|
+
useDefineForClassFields: false
|
|
750
|
+
}
|
|
751
|
+
: {}, preset === 'react'
|
|
752
|
+
? {
|
|
753
|
+
jsx: 'react-jsx'
|
|
754
|
+
}
|
|
755
|
+
: {}, preset === 'preact'
|
|
756
|
+
? {
|
|
757
|
+
jsx: 'react-jsx',
|
|
758
|
+
jsxImportSource: 'preact'
|
|
759
|
+
}
|
|
760
|
+
: {}, preset === 'solid'
|
|
761
|
+
? {
|
|
762
|
+
jsx: 'preserve',
|
|
763
|
+
jsxImportSource: 'solid-js'
|
|
764
|
+
}
|
|
765
|
+
: {}, preset === 'stencil'
|
|
766
|
+
? {
|
|
767
|
+
experimentalDecorators: true,
|
|
768
|
+
jsx: 'react',
|
|
769
|
+
jsxFactory: 'h',
|
|
770
|
+
jsxFragmentFactory: 'Fragment'
|
|
771
|
+
}
|
|
772
|
+
: {})
|
|
773
|
+
},
|
|
774
|
+
include: preset === 'svelte'
|
|
775
|
+
? ['src/**/*.d.ts', 'src/**/*.ts', 'src/**/*.js', 'src/**/*.svelte']
|
|
776
|
+
: preset === 'vue'
|
|
777
|
+
? ['src/**/*.ts', 'src/**/*.d.ts', 'src/**/*.tsx', 'src/**/*.vue']
|
|
778
|
+
: ['test', 'wdio.conf.ts']
|
|
779
|
+
};
|
|
780
|
+
await fs.mkdir(path.dirname(parsedAnswers.tsConfigFilePath), { recursive: true });
|
|
781
|
+
await fs.writeFile(parsedAnswers.tsConfigFilePath, JSON.stringify(config, null, 4));
|
|
774
782
|
console.log(chalk.green.bold('✔ Success!\n'));
|
|
775
783
|
}
|
|
776
784
|
function getPreset(parsedAnswers) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.19.0",
|
|
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",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"typeScriptVersion": "3.8.3",
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@types/node": "^20.1.1",
|
|
49
|
-
"@wdio/config": "8.
|
|
50
|
-
"@wdio/globals": "8.
|
|
49
|
+
"@wdio/config": "8.19.0",
|
|
50
|
+
"@wdio/globals": "8.19.0",
|
|
51
51
|
"@wdio/logger": "8.16.17",
|
|
52
52
|
"@wdio/protocols": "8.18.0",
|
|
53
|
-
"@wdio/types": "8.
|
|
54
|
-
"@wdio/utils": "8.
|
|
53
|
+
"@wdio/types": "8.19.0",
|
|
54
|
+
"@wdio/utils": "8.19.0",
|
|
55
55
|
"async-exit-hook": "^2.0.1",
|
|
56
56
|
"chalk": "^5.2.0",
|
|
57
57
|
"chokidar": "^3.5.3",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"lodash.union": "^4.6.0",
|
|
67
67
|
"read-pkg-up": "10.1.0",
|
|
68
68
|
"recursive-readdir": "^2.2.3",
|
|
69
|
-
"webdriverio": "8.
|
|
69
|
+
"webdriverio": "8.19.0",
|
|
70
70
|
"yargs": "^17.7.2",
|
|
71
71
|
"yarn-install": "^1.0.0"
|
|
72
72
|
},
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "5179b3b3d0bced033e719890baf4517137ac1576"
|
|
87
87
|
}
|