-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathstep_definition_snippets_interfaces.feature
30 lines (26 loc) · 1.24 KB
/
step_definition_snippets_interfaces.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
Feature: step definition snippets custom syntax
As a developer writing my step definitions in another JS dialect
I want to be able to see step definition snippets in the language I prefer
Background:
Given a file named "features/undefined.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given an undefined step
"""
Scenario Outline:
When I run cucumber-js with `--format-options '{"snippetInterface": "<INTERFACE>"}'`
Then it fails
And the output contains the text:
"""
Given('an undefined step', <SNIPPET_FUNCTION_KEYWORD_AND_PARAMETERS> {
// Write code here that turns the phrase above into concrete actions
<SNIPPET_IMPLEMENTATION>;
});
"""
Examples:
| INTERFACE | SNIPPET_FUNCTION_KEYWORD_AND_PARAMETERS | SNIPPET_IMPLEMENTATION |
| callback | function (callback) | callback(null, 'pending') |
| promise | function () | return Promise.resolve('pending') |
| async-await | async function () | return 'pending' |
| synchronous | function () | return 'pending' |