问题
Is is possible to share a common set of examples across multiple scenario outlines in Specflow without duplicating the set of examples for each outline?
e.g. excuse the noddy example, but here the Examples
are repeated for each Scenario Outline
and I want to know if it's possible to declare those Examples
once and use them for each Scenario Outline
?
Feature: Just an example about animals
Scenario Outline:
Given an <animal>
When something happens
Then this should be the outcome
Examples:
| animal |
| Dog |
| Cat |
Scenario Outline:
Given an <animal>
When something different happens
Then this other thing should be the outcome
Examples:
| animal |
| Dog |
| Cat |
回答1:
It appears this is not actually possible in SpecFlow.
回答2:
I am not sure about SepcFlow, but we have done this in Cucumber where the Given step is shared in this instance.
I would expect SpecFlow to work in a the same way.
来源:https://stackoverflow.com/questions/8120779/sharing-a-common-set-of-examples-across-multiple-scenario-outlines-in-specflow