UNPKG

3.18 kBTypeScriptView Raw
1import type { Capabilities, Options, Services } from '@wdio/types';
2import type { PathService, ModuleRequireService } from '../types';
3declare type Spec = string | string[];
4interface TestrunnerOptionsWithParameters extends Omit<Options.Testrunner, 'capabilities'> {
5 watch?: boolean;
6 spec?: string[];
7 suite?: string[];
8 capabilities?: Capabilities.RemoteCapabilities;
9}
10interface MergeConfig extends Omit<Partial<TestrunnerOptionsWithParameters>, 'specs' | 'exclude'> {
11 specs?: Spec[];
12 exclude?: string[];
13}
14export default class ConfigParser {
15 private _pathService;
16 private _moduleRequireService;
17 private _config;
18 private _capabilities;
19 constructor(_pathService?: PathService, _moduleRequireService?: ModuleRequireService);
20 autoCompile(): void;
21 /**
22 * merges config file with default values
23 * @param {String} filename path of file relative to current directory
24 */
25 addConfigFile(filename: string): void;
26 /**
27 * merge external object with config object
28 * @param {Object} object desired object to merge into the config object
29 */
30 merge(object?: MergeConfig): void;
31 /**
32 * Add hooks from an existing service to the runner config.
33 * @param {Object} service - an object that contains hook methods.
34 */
35 addService(service: Services.Hooks): void;
36 /**
37 * get excluded files from config pattern
38 */
39 getSpecs(capSpecs?: string[], capExclude?: string[]): Spec[];
40 /**
41 * sets config attribute with file paths from filtering
42 * options from cli argument
43 *
44 * @param {String[]} cliArgFileList list of files in a string form
45 * @param {Object} config config object that stores the spec and exclude attributes
46 * cli argument
47 * @return {String[]} List of files that should be included or excluded
48 */
49 setFilePathToFilterOptions(cliArgFileList: string[], config: Spec[]): string[];
50 /**
51 * return configs
52 */
53 getConfig(): Required<Options.Testrunner>;
54 /**
55 * return capabilities
56 */
57 getCapabilities(i?: number): Capabilities.DesiredCapabilities | Capabilities.W3CCapabilities | Capabilities.RemoteCapabilities;
58 /**
59 * returns a flattened list of globbed files
60 *
61 * @param {String[] | String[][]} filenames list of files to glob
62 * @param {Boolean} flag to indicate omission of warnings
63 * @param {FileSystemPathService} file system path service for expanding globbed file names
64 * @param {number} hierarchy depth to prevent recursive calling beyond a depth of 1
65 * @return {String[] | String[][]} list of files
66 */
67 static getFilePaths(patterns: Spec[], omitWarnings?: boolean, findAndGlob?: PathService, hierarchyDepth?: number): Spec[];
68 /**
69 * returns specs files with the excludes filtered
70 *
71 * @param {String[] | String[][]} spec files - list of spec files
72 * @param {String[]} exclude files - list of exclude files
73 * @return {String[] | String[][]} list of spec files with excludes removed
74 */
75 filterSpecs(specs: Spec[], exclude: string[]): Spec[];
76}
77export {};
78//# sourceMappingURL=ConfigParser.d.ts.map
\No newline at end of file