UNPKG

2.79 kBJavaScriptView Raw
1const DEFAULT_TIMEOUT = 10000;
2/* istanbul ignore next */
3export const DEFAULT_CONFIGS = () => ({
4 specs: [],
5 suites: {},
6 exclude: [],
7 outputDir: undefined,
8 logLevel: 'info',
9 logLevels: {},
10 groupLogsByTestSpec: false,
11 excludeDriverLogs: [],
12 bail: 0,
13 waitforInterval: 500,
14 waitforTimeout: 5000,
15 framework: 'mocha',
16 reporters: [],
17 services: [],
18 maxInstances: 100,
19 maxInstancesPerCapability: 100,
20 injectGlobals: true,
21 filesToWatch: [],
22 connectionRetryTimeout: 120000,
23 connectionRetryCount: 3,
24 execArgv: [],
25 runnerEnv: {},
26 runner: 'local',
27 shard: {
28 current: 1,
29 total: 1
30 },
31 specFileRetries: 0,
32 specFileRetriesDelay: 0,
33 specFileRetriesDeferred: false,
34 reporterSyncInterval: 100,
35 reporterSyncTimeout: 5000,
36 cucumberFeaturesWithLineNumbers: [],
37 autoCompileOpts: {
38 autoCompile: true,
39 tsNodeOpts: {
40 transpileOnly: true
41 },
42 babelOpts: {}
43 },
44 /**
45 * framework defaults
46 */
47 mochaOpts: {
48 timeout: DEFAULT_TIMEOUT
49 },
50 jasmineOpts: {
51 defaultTimeoutInterval: DEFAULT_TIMEOUT
52 },
53 cucumberOpts: {
54 timeout: DEFAULT_TIMEOUT
55 },
56 /**
57 * hooks
58 */
59 onPrepare: [],
60 onWorkerStart: [],
61 onWorkerEnd: [],
62 before: [],
63 beforeSession: [],
64 beforeSuite: [],
65 beforeHook: [],
66 beforeTest: [],
67 beforeCommand: [],
68 afterCommand: [],
69 afterTest: [],
70 afterHook: [],
71 afterSuite: [],
72 afterSession: [],
73 after: [],
74 onComplete: [],
75 onReload: [],
76 beforeAssertion: [],
77 afterAssertion: [],
78 /**
79 * cucumber specific hooks
80 */
81 beforeFeature: [],
82 beforeScenario: [],
83 beforeStep: [],
84 afterStep: [],
85 afterScenario: [],
86 afterFeature: []
87});
88export const SUPPORTED_HOOKS = [
89 'before', 'beforeSession', 'beforeSuite', 'beforeHook', 'beforeTest', 'beforeCommand',
90 'afterCommand', 'afterTest', 'afterHook', 'afterSuite', 'afterSession', 'after',
91 'beforeAssertion', 'afterAssertion',
92 // @ts-ignore not defined in core hooks but added with cucumber
93 'beforeFeature', 'beforeScenario', 'beforeStep', 'afterStep', 'afterScenario', 'afterFeature',
94 'onReload', 'onPrepare', 'onWorkerStart', 'onWorkerEnd', 'onComplete'
95];
96export const SUPPORTED_FILE_EXTENSIONS = [
97 '.js', '.jsx', '.mjs', '.mts', '.es6', '.ts', '.tsx', '.feature', '.coffee', '.cjs'
98];
99export const NO_NAMED_CONFIG_EXPORT = ('No named export object called "config" found. Make sure you export the config object ' +
100 'via `export.config = { ... }` when using CommonJS or `export const config = { ... }` when ' +
101 'using ESM. Read more on this on https://webdriver.io/docs/configurationfile !');