本文介绍了在Specflow中的多个方案大纲中共享一组通用的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Specflow中的多个场景大纲之间共享一组通用的示例,而不必为每个大纲重复一组示例?

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?

例如请原谅点头例子,但这里为每个场景大纲重复了 Examples ,我想知道是否有可能一次声明这些 Examples 并将它们用于每个场景大纲?

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 |

推荐答案

看来这在SpecFlow中实际上是不可能的.

It appears this is not actually possible in SpecFlow.

这篇关于在Specflow中的多个方案大纲中共享一组通用的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 20:14