-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
using_descriptions.feature
82 lines (59 loc) · 2.41 KB
/
using_descriptions.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
Feature: Using descriptions to give features context
When writing your feature files its very helpful to use description
text at the beginning of the feature file, to write a preamble to the
feature describing clearly exactly what the feature does.
You can also write descriptions attached to individual scenarios - see
the examples below for how this can be used.
It's possible to have your descriptions run over more than one line,
and you can have blank lines too. As long as you don't start a line
with a Given, When, Then, Background:, Scenario: or similar, you're
fine: otherwise Gherkin will start to pay attention.
Background:
Given the standard step definitions
Scenario: Everything with a description
Given a file named "features/test.feature" with:
"""
Feature: descriptions everywhere
We can put a useful description here of the feature, which can
span multiple lines.
Background:
We can also put in descriptions showing what the background is
doing.
Given this step passes
Scenario: I'm a scenario with a description
You can also put descriptions in front of individual scenarios.
Given this step passes
Scenario Outline: I'm a scenario outline with a description
Scenario outlines can have descriptions.
Given this step <state>
Examples: Examples
Specific examples for an outline are allowed to have
descriptions, too.
| state |
| passes |
"""
When I run `cucumber -q`
Then the stderr should not contain anything
Then it should pass with exactly:
"""
Feature: descriptions everywhere
We can put a useful description here of the feature, which can
span multiple lines.
Background:
We can also put in descriptions showing what the background is
doing.
Given this step passes
Scenario: I'm a scenario with a description
You can also put descriptions in front of individual scenarios.
Given this step passes
Scenario Outline: I'm a scenario outline with a description
Scenario outlines can have descriptions.
Given this step <state>
Examples: Examples
Specific examples for an outline are allowed to have
descriptions, too.
| state |
| passes |
2 scenarios (2 passed)
4 steps (4 passed)
"""