-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathprofiles.feature
154 lines (134 loc) · 3.42 KB
/
profiles.feature
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Feature: default command line arguments
In order to prevent users from having to enter the options they use every time
Users can define cucumber.js with profiles which are groups of command line arguments
or partial configuration objects.
Background:
Given a file named "features/a.feature" with:
"""
Feature: some feature
Scenario: some scenario
Given a passing step
"""
And a file named "features/step_definitions/cucumber_steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a passing step$/, function() {})
"""
And a file named "cucumber.js" with:
"""
module.exports = {
'default': '--format summary',
dry: {
dryRun: true
},
progress: '--format progress'
};
"""
Scenario: default profile
When I run cucumber-js
Then it outputs the text:
"""
1 scenario (1 passed)
1 step (1 passed)
<duration-stat>
"""
Scenario Outline: specifying a profile
When I run cucumber-js with `<OPT> progress`
Then it outputs the text:
"""
.
1 scenario (1 passed)
1 step (1 passed)
<duration-stat>
"""
Examples:
| OPT |
| -p |
| --profile |
Scenario: specifying multiple profiles
When I run cucumber-js with `-p dry -p progress`
Then it outputs the text:
"""
-
1 scenario (1 skipped)
1 step (1 skipped)
<duration-stat>
"""
Scenario: overriding the default profile
When I run cucumber-js with `-f summary`
Then it outputs the text:
"""
1 scenario (1 passed)
1 step (1 passed)
<duration-stat>
"""
Scenario Outline: specifying a configuration file
Given a file named ".cucumber-rc.js" with:
"""
module.exports = {
'default': '--dry-run'
};
"""
When I run cucumber-js with `<OPT> .cucumber-rc.js`
Then it outputs the text:
"""
-
1 scenario (1 skipped)
1 step (1 skipped)
<duration-stat>
"""
Examples:
| OPT |
| -c |
| --config |
Scenario Outline: specifying a esm configuration file with default function profile
Given a file named ".cucumber-rc.mjs" with:
"""
export default function buildProfiles() {
return {
default: '--dry-run'
}
}
"""
When I run cucumber-js with `-c .cucumber-rc.mjs`
Then it outputs the text:
"""
-
1 scenario (1 skipped)
1 step (1 skipped)
<duration-stat>
"""
Scenario: specifying a configuration file that doesn't exist
When I run cucumber-js with `--config doesntexist.js`
Then it fails
Scenario: using a JSON file
Given a file named ".cucumber-rc.json" with:
"""
{
"default": {
"dryRun": true
}
}
"""
When I run cucumber-js with `--config .cucumber-rc.json`
Then it outputs the text:
"""
-
1 scenario (1 skipped)
1 step (1 skipped)
<duration-stat>
"""
Scenario: using a YAML file
Given a file named ".cucumber-rc.yaml" with:
"""
default:
dryRun: true
"""
When I run cucumber-js with `--config .cucumber-rc.yaml`
Then it outputs the text:
"""
-
1 scenario (1 skipped)
1 step (1 skipped)
<duration-stat>
"""