Andrio
Andrio

Reputation: 2088

Running all scenarios in a feature file, multiple times with different parameters?

Let's say I have a feature file that tests sending messages. This functionality is the same for admins, supervisors, and employees, so the same scenarios will work on the three different types of accounts. But I want to test all three kinds of accounts.

Can I set all the Scenarios in my feature to run three times, on each kind of account, only using Background?

I know I can do something like this:

Scenario Outline: Test sending messages
Given a <user>
    And some stuff here
When I click Send
Then The messages should be sent

Examples: 
| user       |
| Admin      |
| Supervisor |
| Employee   |

That example works, however by doing that, I have to reuse that same Examples column for every Scenario, rather than just once in the Background.

Upvotes: 0

Views: 1130

Answers (1)

Sam Holder
Sam Holder

Reputation: 32954

No, this isn't supported I don't think. This sort of functionality has been requested a few times, but I think its the gherkin syntax that doesn't support this, so it would need to be extended first I think, before specflow could be extended to support it.

Upvotes: 1

Related Questions