-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44b2cb9
commit eef8746
Showing
2 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
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: | ||
""" | ||
import {defineSupportCode} from 'cucumber' | ||
defineSupportCode(({Given}) => { | ||
Given(/^a passing step$/, function() {}); | ||
}) | ||
""" | ||
|
||
Scenario Outline: slow handler timeout | ||
Given a file named "features/support/handlers.js" with: | ||
""" | ||
import {defineSupportCode} from 'cucumber' | ||
defineSupportCode(({<TYPE>, setDefaultTimeout}) => { | ||
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 after 500 milliseconds | | ||
| features/support/handlers.js:6 | | ||
|
||
Examples: | ||
| TYPE | | ||
| BeforeAll | | ||
| AfterAll | | ||
|
||
Scenario Outline: slow handler can increase their timeout | ||
Given a file named "features/supports/handlers.js" with: | ||
""" | ||
import {defineSupportCode} from 'cucumber' | ||
defineSupportCode(({<TYPE>, setDefaultTimeout}) => { | ||
setDefaultTimeout(500) | ||
<TYPE>({timeout: 1500}, function(callback) { | ||
setTimeout(callback, 1000) | ||
}) | ||
}) | ||
""" | ||
When I run cucumber.js | ||
Then it passes | ||
|
||
Examples: | ||
| TYPE | | ||
| BeforeAll | | ||
| AfterAll | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters