-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconstants.ts
More file actions
115 lines (105 loc) · 2.5 KB
/
constants.ts
File metadata and controls
115 lines (105 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
export const PAGE_TRANSITION_COMMANDS: string[] = [
'url',
'navigateTo',
'elementClick',
'click'
]
export const DEFAULT_LAUNCH_CAPS: WebdriverIO.Capabilities = {
browserName: 'chrome',
'goog:chromeOptions': {
// production:
args: ['--window-size=1600,1200']
// development:
// args: ['--window-size=1600,1200', '--auto-open-devtools-for-tabs']
}
}
export const INTERNAL_COMMANDS = [
'emit',
'browsingContextLocateNodes',
'browsingContextNavigate',
'waitUntil',
'getTitle',
'getUrl',
'getWindowSize',
'setWindowSize',
'deleteSession',
'findElementFromShadowRoot',
'findElementsFromShadowRoot',
'waitForExist',
'browsingContextGetTree',
'scriptCallFunction',
'getElement',
'execute',
'findElement',
'getElementText',
'getElementShadowRoot'
]
export const CONTEXT_CHANGE_COMMANDS = [
'url',
'back',
'forward',
'refresh',
'switchFrame',
'newWindow',
'createWindow',
'closeWindow'
]
/**
* Existing pattern (kept for any external consumers)
*/
export const SPEC_FILE_PATTERN =
/\/(test|spec|features|pageobjects|@wdio\/expect-webdriverio)\//i
/**
* Parser options
*/
export const PARSE_PLUGINS = [
'typescript',
'jsx',
'decorators-legacy',
'classProperties',
'dynamicImport'
] as const
/**
* Test framework identifiers
*/
export const TEST_FN_NAMES = ['it', 'test', 'specify', 'fit', 'xit'] as const
export const SUITE_FN_NAMES = ['describe', 'context', 'suite'] as const
export const STEP_FN_NAMES = [
'Given',
'When',
'Then',
'And',
'But',
'defineStep'
] as const
/**
* File/type recognizers
*/
export const STEP_FILE_RE = /\.(?:steps?)\.[cm]?[jt]sx?$/i
export const STEP_DIR_RE =
/(?:^|\/)(?:step[-_]?definitions|steps)\/.+\.[cm]?[jt]sx?$/i
export const SPEC_FILE_RE = /\.(?:test|spec)\.[cm]?[jt]sx?$/i
export const FEATURE_FILE_RE = /\.feature$/i
export const SOURCE_FILE_EXT_RE = /\.(?:[cm]?js|[cm]?ts)x?$/
/**
* Gherkin Feature/Scenario line
*/
export const FEATURE_OR_SCENARIO_LINE_RE =
/^\s*(Feature|Scenario(?: Outline)?):\s*(.+)\s*$/i
/**
* Step definition textual scan regexes
*/
export const STEP_DEF_REGEX_LITERAL_RE =
/\b(Given|When|Then|And|But)\s*\(\s*(\/(?:\\.|[^/\\])+\/[gimsuy]*)/
export const STEP_DEF_STRING_RE =
/\b(Given|When|Then|And|But)\s*\(\s*(['`])([^'`\\]*(?:\\.[^'`\\]*)*)\2/
/**
* Step directories discovery
*/
export const STEPS_DIR_CANDIDATES = [
'step-definitions',
'step_definitions',
'steps'
] as const
export const STEPS_DIR_ASCENT_MAX = 6
export const STEPS_GLOBAL_SEARCH_MAX_DEPTH = 5