Sharing a common set of Examples across multiple Scenario Outlines in Specflow

故事扮演 提交于 2021-02-07 11:31:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!