-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathbefore_after_all_hook_timeouts.feature
57 lines (47 loc) · 1.54 KB
/
before_after_all_hook_timeouts.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
Feature: before / after all hook timeouts
Background:
Given a file named "features/a.feature" with:
"""
Feature:
Scenario:
Given a passing step
"""
And a file named "features/step_definitions/steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
Given(/^a passing step$/, function() {});
"""
Scenario Outline: slow handler timeout
Given a file named "features/support/handlers.js" with:
"""
const {<TYPE>, setDefaultTimeout} = require('@cucumber/cucumber')
setDefaultTimeout(500)
<TYPE>(function(callback) {
setTimeout(callback, 1000)
})
"""
When I run cucumber-js
Then it fails
And the error output contains the text snippets:
| a handler errored, process exiting |
| function timed out, ensure the callback is executed within 500 milliseconds |
| features/support/handlers.js:5 |
Examples:
| TYPE |
| BeforeAll |
| AfterAll |
Scenario Outline: slow handlers can increase their timeout
Given a file named "features/supports/handlers.js" with:
"""
const {<TYPE>, setDefaultTimeout} = require('@cucumber/cucumber')
setDefaultTimeout(500)
<TYPE>({timeout: 1500}, function(callback) {
setTimeout(callback, 1000)
})
"""
When I run cucumber-js
Then it passes
Examples:
| TYPE |
| BeforeAll |
| AfterAll |