【问题标题】:Cucumber tags chaining黄瓜标签链接
【发布时间】:2021-06-09 11:33:57
【问题描述】:

我在考虑链接标签

来自https://cucumber.io/docs/cucumber/api/的基本示例

@billing
Feature: Verify billing

  @important
  Scenario: Missing product description
    Given hello

  Scenario: Several products
    Given hello

我想做的是

@billing
Feature: Verify billing

  @important
  Scenario: Missing product description
    Given hello

  Scenario: Several products
    Given hello please run @important tag 

@important 的所有步骤都会执行,这可能吗?我在谷歌没有找到任何例子:( 如果可以,你能帮我找些材料吗?

堆栈: 带有 cypress-cucumber-preprocessor 的 JS https://github.com/TheBrainFamily/cypress-cucumber-preprocessor 我还查看了所有示例,但没有看到类似的内容

感谢您的帮助:)

【问题讨论】:

    标签: testing cucumber e2e-testing gherkin


    【解决方案1】:

    听起来您是在说您希望能够在另一个场景中重复使用现有场景中的步骤,对吗?

    我不会尝试在 Gherkin 级别组织重用(这不是一种编程语言,而是一种规范语言),我会在您的步骤定义中的代码中降低级别.

    剧本模式是帮助您组织步骤定义代码的一个非常好的模式,它允许您创建可重复使用的可组合自动化代码“块”。

    这是我写的关于该模式的博客文章:https://cucumber.io/blog/bdd/understanding-screenplay-(part-1)/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-21
      • 1970-01-01
      • 2018-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多