-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathrun_specific_scenarios.feature
76 lines (61 loc) · 1.93 KB
/
run_specific_scenarios.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
Feature: Run specific scenarios
You can choose to run a specific scenario using the file:line format,
or you can pass in a file with a list of scenarios using @-notation.
The line number can fall anywhere within the body of a scenario, including
steps, tags, comments, description, data tables or doc strings.
For scenario outlines, if the line hits one example row, just that one
will be run. Otherwise all examples in the table or outline will be run.
Background:
Given the standard step definitions
Scenario: Two scenarios, run just one of them
Given a file named "features/test.feature" with:
"""
Feature:
Scenario: Miss
Given this step is undefined
Scenario: Hit
Given this step passes
"""
When I run `cucumber features/test.feature:6 --format pretty --quiet `
Then it should pass with exactly:
"""
Feature:
Scenario: Hit
Given this step passes
1 scenario (1 passed)
1 step (1 passed)
"""
Scenario: Use @-notation to specify a file containing feature file list
Given a file named "features/test.feature" with:
"""
Feature: Sample
Scenario: Passing
Given this step passes
"""
And a file named "list-of-features.txt" with:
"""
features/test.feature:2
"""
When I run `cucumber -q @list-of-features.txt`
Then it should pass with:
"""
Feature: Sample
Scenario: Passing
Given this step passes
1 scenario (1 passed)
1 step (1 passed)
"""
Scenario: Specify order of scenarios
Given a file named "features/test.feature" with:
"""
Feature:
Scenario:
Given this step passes
Scenario:
Given this step fails
"""
When I run `cucumber features/test.feature:5 features/test.feature:2 -f progress`
Then it should fail with:
"""
F.
"""