features/docs/cli/run_specific_scenarios.feature in cucumber-2.0.0.rc.5 vs features/docs/cli/run_specific_scenarios.feature in cucumber-2.0.0
- old
+ new
@@ -1,93 +1,38 @@
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:
+
+ Scenario: Miss
Given this step is undefined
Scenario: Hit
Given this step passes
"""
- When I run `cucumber features/test.feature:5 -f progress`
+ When I run `cucumber features/test.feature:7 --format pretty --quiet`
Then it should pass with:
"""
- 1 scenario (1 passed)
- """
+ Feature:
- Scenario: Single example from a scenario outline
- Given a file named "features/test.feature" with:
- """
- Feature:
- Scenario Outline:
- Given this step <something>
-
- Examples:
- | something |
- | is undefined |
- | fails |
-
- Scenario: Miss
+ Scenario: Hit
Given this step passes
- """
- When I run `cucumber features/test.feature:8 -f progress`
- Then it should fail with:
- """
- 1 scenario (1 failed)
- """
- @spawn
- Scenario: Specify 2 line numbers where one is a tag
- Given a file named "features/test.feature" with:
- """
- Feature: Sample
-
- @two @three
- Scenario:
- Given this step passes
-
- @four
- Scenario:
- Given this step passes
- """
- When I run `cucumber -q features/test.feature:3:8`
- Then it should pass with:
- """
- 2 scenarios (2 passed)
- 2 steps (2 passed)
- """
-
- Scenario: Specify the line number of a row
- Given a file named "features/test.feature" with:
- """
- Feature: Sample
- Scenario: Passing
- Given this step is a table step
- | a | b |
- | c | d |
-
- """
- When I run `cucumber -q features/test.feature:4`
- Then it should pass with:
- """
- Feature: Sample
-
- Scenario: Passing
- Given this step is a table step
- | a | b |
- | c | d |
-
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:
"""