在 Specflow 中跨多个场景大纲共享一组通用示例 [英] Sharing a common set of Examples across multiple Scenario Outlines in Specflow

查看:20
本文介绍了在 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 为每个 Scenario Outline 重复,我想知道是否可以声明这些 Examples 一次并且将它们用于每个Scenario 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 |

推荐答案

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

It appears this is not actually possible in SpecFlow.

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆