【问题标题】:How to run multiple tags at once in Cucumber / Cypress JS project?如何在 Cucumber/Cypress JS 项目中一次运行多个标签?
【发布时间】:2022-12-18 11:02:55
【问题描述】:

在我的 Cypress JS / Cucumber 项目中,我正在尝试使用不同的标签运行多个测试场景。

Feature: First feature

    @tagOne
    Scenario: #1 Navigation

另一个特点:

Feature: Secondfeature

    @tagTwo
    Scenario: #1 Visibility

我可以使用以下命令单独运行标签:

npx cypress run -e TAGS=\"@tagOne\"
npx cypress run -e TAGS=\"@tagTwo\"

但是,我现在需要同时运行它们。

当我运行以下命令时,只有 tagOne 场景在运行,而 tagTwo 场景处于待处理状态。

npx cypress run -e TAGS=\"@tagOne or @tagTwo\"

有人可以告诉我如何同时运行这些标签吗?

【问题讨论】:

    标签: cucumber cypress


    【解决方案1】:

    根据syntax,这些是选项。

    Old style command line Cucumber Expressions style command line
    --tags @dev --tags @dev
    --tags ~@dev --tags "not @dev"
    --tags @foo,@bar --tags "@foo or @bar"
    --tags @foo --tags @bar --tags "@foo and bar"
    --tags ~@foo --tags @bar,@zap --tags "not @foo and (@bar or @zap)"

    如果这与布尔表达式的工作方式相同,or 将在第一个匹配的表达式处停止。

    你应该试试and

    npx cypress run -e TAGS="@tagOne and @tagTwo"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      • 2023-02-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多