Say I have a feature like this:
Feature: Foods in containers
Scenario Outline:
When a chicken is inserted into a <container>
Then it gets <condition>
Examples:
| container | condition |
| oven | hot |
| freezer | cold |
Scenario Outline:
When a roast is inserted into a <container>
Then it gets <condition>
Examples:
| container | condition |
| oven | hot |
| freezer | cold |
As can be seen the when, then, and examples are the same for both scenario outlines.
Is it possible to reuse the example tables? I would like to do something like this instead
(or using a similar syntax):
Feature: Foods in containers
Examples: MyExamples
| container | condition |
| oven | hot |
| freezer | cold |
Scenario Outline:
When a chicken is inserted into a <container>
Then it gets <condition>
Using MyExamples
Scenario Outline:
When a roast is inserted into a <container>
Then it gets <condition>
Using MyExamples
Of cause I could just flatten it out like this:
Feature: Foods in containers
Scenario Outline:
When a <food> is inserted into a <container>
Then it gets <condition>
Examples:
| food | container | condition |
| chicken | oven | hot |
| chicken | freezer | cold |
| roast | oven | hot |
| roast | freezer | cold |
But in my real-life case, the number of scenario outlines are about 10 and the example tables have
like 10+ entries. So the cross product would be enormous.
Is what I'm suggesting in any way possible? Or could I attack my problem in another way, so that I
get a higher degree of reuse and maintainability in some other way?
Any help is appreciated };-P