1 | import { ConfigParser } from '@wdio/config/node';
|
2 | import type { Services } from '@wdio/types';
|
3 | import CLInterface from './interface.js';
|
4 | import type { RunCommandArguments } from './types.js';
|
5 | export interface EndMessage {
|
6 | cid: string;
|
7 | exitCode: number;
|
8 | specs: string[];
|
9 | retries: number;
|
10 | }
|
11 | declare class Launcher {
|
12 | private _configFilePath;
|
13 | private _args;
|
14 | private _isWatchMode;
|
15 | configParser: ConfigParser;
|
16 | isMultiremote: boolean;
|
17 | isParallelMultiremote: boolean;
|
18 | runner?: Services.RunnerInstance;
|
19 | interface?: CLInterface;
|
20 | private _exitCode;
|
21 | private _hasTriggeredExitRoutine;
|
22 | private _schedule;
|
23 | private _rid;
|
24 | private _runnerStarted;
|
25 | private _runnerFailed;
|
26 | private _launcher?;
|
27 | private _resolve?;
|
28 | constructor(_configFilePath: string, _args?: Partial<RunCommandArguments>, _isWatchMode?: boolean);
|
29 | /**
|
30 | * run sequence
|
31 | * @return {Promise} that only gets resolved with either an exitCode or an error
|
32 | */
|
33 | run(): Promise<undefined | number>;
|
34 | /**
|
35 | * run without triggering onPrepare/onComplete hooks
|
36 | */
|
37 | private _runMode;
|
38 | /**
|
39 | * Format the specs into an array of objects with files and retries
|
40 | */
|
41 | private _formatSpecs;
|
42 | /**
|
43 | * run multiple single remote tests
|
44 | * @return {Boolean} true if all specs have been run and all instances have finished
|
45 | */
|
46 | private _runSpecs;
|
47 | /**
|
48 | * gets number of all running instances
|
49 | * @return {number} number of running instances
|
50 | */
|
51 | private _getNumberOfRunningInstances;
|
52 | /**
|
53 | * get number of total specs left to complete whole suites
|
54 | * @return {number} specs left to complete suite
|
55 | */
|
56 | private _getNumberOfSpecsLeft;
|
57 | /**
|
58 | * Start instance in a child process.
|
59 | * @param {Array} specs Specs to run
|
60 | * @param {number} cid Capabilities ID
|
61 | * @param {string} rid Runner ID override
|
62 | * @param {number} retries Number of retries remaining
|
63 | */
|
64 | private _startInstance;
|
65 | private _workerHookError;
|
66 | /**
|
67 | * generates a runner id
|
68 | * @param {number} cid capability id (unique identifier for a capability)
|
69 | * @return {String} runner id (combination of cid and test id e.g. 0a, 0b, 1a, 1b ...)
|
70 | */
|
71 | private _getRunnerId;
|
72 | /**
|
73 | * Close test runner process once all child processes have exited
|
74 | * @param {number} cid Capabilities ID
|
75 | * @param {number} exitCode exit code of child process
|
76 | * @param {Array} specs Specs that were run
|
77 | * @param {number} retries Number or retries remaining
|
78 | */
|
79 | private _endHandler;
|
80 | /**
|
81 | * We need exitHandler to catch SIGINT / SIGTERM events.
|
82 | * Make sure all started selenium sessions get closed properly and prevent
|
83 | * having dead driver processes. To do so let the runner end its Selenium
|
84 | * session first before killing
|
85 | */
|
86 | private _exitHandler;
|
87 | /**
|
88 | * returns true if user stopped watch mode, ex with ctrl+c
|
89 | * @returns {boolean}
|
90 | */
|
91 | private _isWatchModeHalted;
|
92 | }
|
93 | export default Launcher;
|
94 | //# sourceMappingURL=launcher.d.ts.map |
\ | No newline at end of file |