This repository has been archived by the owner on May 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
undefined_steps.feature
92 lines (86 loc) · 3.63 KB
/
undefined_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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Feature: Undefined steps
In order to do Behaviour-Driven Development
As a developer
I want to see the details about undefined steps
Scenario: step definition snippet suggestion
Given a scenario with:
"""
Given I am a veggie
When I eat meat
Then I get sick
"""
And the step "I am a veggie" has no mapping
And the step "I eat meat" has no mapping
And the step "I get sick" has no mapping
When Cucumber executes the scenario
Then a "Given" step definition snippet for /^I am a veggie$/ is suggested
And a "When" step definition snippet for /^I eat meat$/ is suggested
And a "Then" step definition snippet for /^I get sick$/ is suggested
Scenario: repeating steps (And, But)
Given a scenario with:
"""
Given I am a veggie
And I love food
When I eat gherkins
And I eat cucumbers
Then I feel satiated
And I feel energized
But I have nothing left to eat
"""
And the steps have no mappings
When Cucumber executes the scenario
Then a "Given" step definition snippet for /^I am a veggie$/ is suggested
And a "Given" step definition snippet for /^I love food$/ is suggested
And a "When" step definition snippet for /^I eat gherkins$/ is suggested
And a "When" step definition snippet for /^I eat cucumbers$/ is suggested
And a "Then" step definition snippet for /^I feel satiated$/ is suggested
And a "Then" step definition snippet for /^I feel energized$/ is suggested
And a "Then" step definition snippet for /^I have nothing left to eat$/ is suggested
Scenario: star steps (*)
All keywords are aliased to * in all i18n translations of Gherkin. The
purpose is to allow a bullet-list style of steps. Just like with the And
and But keywords, the previous keyword should be used for step definitions.
If there are no previous steps, use Given.
Given a scenario with:
"""
* I am a veggie
* I love food
When I eat gherkins
* I eat cucumbers
Then I feel satiated
* I feel energized
* I have nothing left to eat
"""
And the steps have no mappings
When Cucumber executes the scenario
Then a "Given" step definition snippet for /^I am a veggie$/ is suggested
And a "Given" step definition snippet for /^I love food$/ is suggested
And a "When" step definition snippet for /^I eat gherkins$/ is suggested
And a "When" step definition snippet for /^I eat cucumbers$/ is suggested
And a "Then" step definition snippet for /^I feel satiated$/ is suggested
And a "Then" step definition snippet for /^I feel energized$/ is suggested
And a "Then" step definition snippet for /^I have nothing left to eat$/ is suggested
Scenario: step with doc strings
Given a scenario with:
"""
Given the following Wikipedia excerpt:
\"\"\"
The cucumber (Cucumis sativus) is a widely cultivated plant
in the gourd family Cucurbitaceae, which includes squash,
and in the same genus as the muskmelon.
\"\"\"
"""
When Cucumber executes the scenario
Then a "Given" step definition snippet for /^the following Wikipedia excerpt:$/ with a doc string is suggested
Scenario: step with data tables:
Given a scenario with:
"""
Given the following cucumbers:
| variety | score |
| persian | 3 |
| c-thru-cumber | 1 |
| lebanese | 4 |
| kekiri | 5 |
"""
When Cucumber executes the scenario
Then a "Given" step definition snippet for /^the following cucumbers:$/ with a data table is suggested