jeudi 13 octobre 2016

BDD Gherkin Scripts: Same group of scenarions against multiple roles

I have a feature with a number of scenarios that need to be tested where the user is logged in as a number of possible roles (and the outcome should be the same).

Is it possible to put an Examples table into the background? For example:

Feature: My general set of tests

Background:
Given I am logged in 
And I am logged in as <role>

Examples:
| role    |
| Sales   |
| Support |
| Admin   |
| Auditor |

Scenario: tests1 blah...

Scenario Outline: tests 2 blah...

So what I want to do is iterate through the who feature file with a different Background context rather than having to maintain a separate feature file for each role. Is this possible?

Aucun commentaire:

Enregistrer un commentaire