Reputation: 23443
I would like to know if it is possible to execute using cucumber-jvm
a scenario / feature multiple times. Thanks.
Upvotes: 2
Views: 5383
Reputation: 144
Your can use several approaches:
On operation system level: run command several times or write appropriate shell script.
On Cucumber level. E.g. you have following feature file:
Feature: My great feature
Scenario: My scenario
Given My given step one
When My when step two
Then My then step three
You can force cucumber-jvm run it several times e.g. 3 by transforming "Scenario" to "Scenario outlines" and using "Examples":
Feature: My great feature
Scenario **Outline**: My scenario
Given My given step <number>
When My when step two
Then My then step three
Examples: to run this scenario several times
|number|
|one|
|one|
|one|
It looks some artificially, but works. I use this approach to gather statistics for complex tests dependent of a lot of conditions.
Upvotes: 3