I've got a feature (a .feature file) that are working fine in cucumber.
The background of all the scenarios in the feature just sets up a user, and then logs in as a supervisor, e.g.
Background:
Given I am logged in as a supervisor with an existing supervisee
...loads of scenarios
However the design/goals of the application has changed and the same scenarios should all work whether you are logged in as a supervisor or as the user. This is not true for most of the rest of the application where the design is not symmetrical for supervisors/users.
Is there any sane way to avoid copying and pasting the whole of the feature file with a different background? It doesn't seem like there's a way to either parameterize background (e.g. with an Either: Or: stanza) or alternatively a way to pull in an external file with a load of scenarios. Ideas?
Background:
Given I am logged in as an existing supervisee
...same loads of scenarios
Here's some fantasy gherkin syntax (that doesn't exist)
Background Outline:
Given I am logged in as a <user>
Backgrounds:
| user |
| supervisor with an existing supervisee |
| an existing supervisee |
...loads of scenarios
Alternatively different fantasy Gherkin syntax :
Background:
Given I am logged in as an existing supervisee
Include Scenarios:
supervisor.features