Skip to content

Commit d68f54e

Browse files
committed
Add example with parameterized Scenario Outline
When using a Scenario Outline it is possible to use a placeholder in the name of that Scenario Outline. The resulting pickle will have the placeholder replaced with a value from the example tables. This allows us to test use cases where this matter such as: - cucumber/junit-xml-formatter#34 - cucumber/testng-xml-formatter#4 Fixes: #96
1 parent 971ca50 commit d68f54e

File tree

4 files changed

+126
-66
lines changed

4 files changed

+126
-66
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
9+
### Added
10+
- Add example with parameterized Scenario Outline ([#98](https://github.com/cucumber/compatibility-kit/pull/98))
11+
912
### Fixed
1013
- [Ruby] Fixed a duplicate conflicting method that caused the CCK not to load feature paths ([#95](https://github.com/cucumber/compatibility-kit/pull/95))
1114

devkit/samples/examples-tables/examples-tables.feature

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
Feature: Examples Tables
22
Sometimes it can be desirable to run the same scenario multiple times with
3-
different data each time - this can be done by placing an Examples table underneath
4-
a Scenario, and use <placeholders> in the Scenario which match the table headers.
3+
different data each time - this can be done by placing an Examples table
4+
underneath a Scenario, and use <placeholders> in the Scenario which match the
5+
table headers.
6+
7+
The Scenario Outline name can also be parameterized. The name of the resulting
8+
pickle will have the <placeholder> replaced with the value from the examples
9+
table.
510

611
Scenario Outline: Eating cucumbers
712
Given there are <start> cucumbers
@@ -25,3 +30,14 @@ Feature: Examples Tables
2530
| start | eat | left |
2631
| 12 | banana | 12 |
2732
| 0 | 1 | apple |
33+
34+
Scenario Outline: Eating cucumbers with <friends> friends
35+
Given there are <friends> friends
36+
When there are <start> cucumbers
37+
Then each person can eat <share> cucumbers
38+
39+
Examples:
40+
| start | friends | share |
41+
| 12 | 11 | 1 |
42+
| 4 | 1 | 2 |
43+
| 4 | 0 | 4 |

0 commit comments

Comments
 (0)