-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathpending_steps.feature
55 lines (47 loc) · 1.49 KB
/
pending_steps.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
Feature: Pending steps
Background:
Given a file named "features/pending.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given a pending step
"""
Scenario: Synchronous pending step
Given a file named "features/step_definitions/failing_steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a pending step$/, function() {
return 'pending'
})
"""
When I run cucumber-js
Then it fails
And scenario "a scenario" step "Given a pending step" has status "pending"
Scenario: Callback pending step
Given a file named "features/step_definitions/failing_steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a pending step$/, function(callback) {
callback(null, 'pending')
})
"""
When I run cucumber-js
Then it fails
And scenario "a scenario" step "Given a pending step" has status "pending"
Scenario: Promise pending step
Given a file named "features/step_definitions/failing_steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a pending step$/, function(){
return {
then: function(onResolve, onReject) {
setTimeout(function() {
onResolve('pending')
})
}
}
})
"""
When I run cucumber-js
Then it fails
And scenario "a scenario" step "Given a pending step" has status "pending"