【问题标题】:Cucumber scenario with multiple tags does not execute in Cypress具有多个标签的 Cucumber 场景不会在 Cypress 中执行
【发布时间】:2021-12-31 04:12:00
【问题描述】:

我有一个场景的多个标签,并尝试使用 Cypress run -env TAGS 命令执行该场景,但使用 Cypress-Cucumber-Preprocess 无法正常工作。

@Tag1 @Tag2 @Tag3 场景:第一个场景

@Tag1 @Tag2 @Tag3 @Tag4 场景:第二个场景

cypress run -e TAGS='@Tag4' - 不工作

这两个场景都将在 testrunner 中打开并且测试运行器冻结。

【问题讨论】:

  • 也许您可以添加一个场景作为示例来改进您的问题

标签: cucumber cypress cypress-cucumber-preprocessor


【解决方案1】:

您应该使用内置的cypress-tags run 命令而不是cypress run,例如:

cypress-tags run -e TAGS=\"@Tag1 and not @Tag4\" --browser chrome --headless

这允许您仅运行带有特定标签的场景或明确不运行特定标签。

【讨论】:

  • 我试过了。它过滤的是功能文件,而不是场景。此外,在测试运行程序中,与标签不匹配的场景正在尝试执行并冻结
  • 也许你可以查看这个官方仓库中的示例,这些至少对我有用:github.com/TheBrainFamily/cypress-cucumber-example
  • 如果这些对您也不起作用,您能否添加您正在使用的 cypress 和 cucumber 预处理器版本。
  • "cypress-cucumber-preprocessor": "^4.0.1" "cypress": "^9.2.0",
猜你喜欢
  • 2017-09-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-07-27
  • 1970-01-01
  • 1970-01-01
  • 2022-12-18
相关资源
最近更新 更多