Cucumber / Cucumber Js / Docs
before / after all hook timeouts
Background:
- Given a file named "
features/a.feature" with:gherkinFeature: Scenario: Given a passing step - And a file named "
features/step_definitions/steps.js" with:rubyconst {Given} = require('@cucumber/cucumber') Given(/^a passing step$/, function() {});
Scenario Outline: slow handler timeout
- Given a file named "
features/support/handlers.js" with:rubyconst {<TYPE>, setDefaultTimeout} = require('@cucumber/cucumber') setDefaultTimeout(500) <TYPE>(function(callback) { setTimeout(callback, 1000) }) - When I run cucumber-js
- Then it fails
- And the output contains the text:
text
1 hook (1 failed) - And the output contains the text:
text
function timed out, ensure the callback is executed within 500 milliseconds - And the output contains the text:
text
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:rubyconst {<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 |
Source: features/before_after_all_hook_timeouts.feature at commit 3ac6ecda, Cucumber Js (MIT license).