-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathformatters.feature
121 lines (109 loc) · 4.03 KB
/
formatters.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
Feature: Formatters
Scenario: rejected pickle
Given a file named "features/a.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given a step
"""
When I run cucumber-js with all formatters and `--tags @a`
Then the message formatter output matches the fixture "formatters/rejected-pickle.message.json"
Then the json formatter output matches the fixture "formatters/rejected-pickle.json"
Then the html formatter output is complete
Scenario: passed from Scenario
Given a file named "features/a.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given a step
"""
Given a file named "features/step_definitions/steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a step$/, function() {})
"""
When I run cucumber-js with all formatters
Then the message formatter output matches the fixture "formatters/passed-scenario.message.json"
Then the json formatter output matches the fixture "formatters/passed-scenario.json"
Then the html formatter output is complete
Scenario: passed from Scenario Outline
Given a file named "features/a.feature" with:
"""
Feature: a feature
Scenario Outline: a scenario
Given a <thing>
Examples:
| thing |
| hop |
| step |
| jump |
"""
Given a file named "features/step_definitions/steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given('a hop', function() {})
Given('a step', function() {})
Given('a jump', function() {})
"""
When I run cucumber-js with all formatters
Then the message formatter output matches the fixture "formatters/passed-scenario-outline.message.json"
Then the json formatter output matches the fixture "formatters/passed-scenario-outline.json"
Then the html formatter output is complete
Scenario: passed from Rule
Given a file named "features/a.feature" with:
"""
Feature: a feature
Rule: a rule
Example: an example
Given a step
"""
Given a file named "features/step_definitions/steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a step$/, function() {})
"""
When I run cucumber-js with all formatters
Then the message formatter output matches the fixture "formatters/passed-rule.message.json"
Then the json formatter output matches the fixture "formatters/passed-rule.json"
Then the html formatter output is complete
Scenario: failed
Given a file named "features/a.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given a step
"""
Given a file named "features/step_definitions/steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a step$/, function(callback) { callback(new Error('my error')) })
"""
When I run cucumber-js with all formatters
Then the message formatter output matches the fixture "formatters/failed.message.json"
Then the json formatter output matches the fixture "formatters/failed.json"
Then the html formatter output is complete
And it fails
Scenario: retried and passed
Given a file named "features/a.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given a step
"""
Given a file named "features/step_definitions/steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
let willPass = false
Given(/^a step$/, function(callback) {
if (willPass) {
callback()
return
}
willPass = true
callback(new Error('my error'))
})
"""
When I run cucumber-js with all formatters and `--retry 1`
Then the message formatter output matches the fixture "formatters/retried.message.json"
Then the json formatter output matches the fixture "formatters/retried.json"
Then the html formatter output is complete