UNPKG

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