【问题标题】:Cucumber: @wip flag behaves strangely with Guard [duplicate]Cucumber:@wip 标志与 Guard 的行为异常 [重复]
【发布时间】:2012-07-11 12:37:48
【问题描述】:

可能重复:
How do you get cucumber/guard to filter on tags like @wip?

我有以下几种情况:

Feature: List projects
  In order to manage projects
  As a user
  I want to see a list of them

  Background:
    Given I am logged in

  @wip
  Scenario: I go to the projects
    When  I go to the projects
    Then  I should see a list of projects

  Scenario: I go to the projects2
    When  I go to the projects
    Then  I should see a list of projects

当运行它时(通过保存它以便被 Guard 调用),只有第二个被执行,正如预期的那样。但是当保存任何其他功能时(这也使此功能运行),@wip 标记似乎被忽略了。这是正常行为吗?

更新

通过使用--tags ~@ignore,我可以禁用任意数量的功能。我仍然没有真正了解@wip 的工作原理(或者更好的是:为什么它会以这种方式工作)。

【问题讨论】:

  • 如果您想问另一个(虽然非常相似)问题,请在您的问题下方指定它或(更好地)提出新问题。不要改变你的问题,因为你已经收到的答案在它之后变得无关紧要。
  • 我不明白“但是当保存任何其他功能(这也使该功能运行)时,@wip 标签似乎被忽略了。”。你能解释一下吗?
  • 我正在运行警卫,当我当前处理的功能通过时,它会自动运行所有功能。

标签: cucumber scenarios


【解决方案1】:

您可以在没有此 tag 的情况下运行所有​​场景:

cucumber --tags ~@ignore

【讨论】:

  • 请注意,在发布问题后,这个答案是正确的,但后来的问题被修改了。
猜你喜欢
  • 2012-02-29
  • 1970-01-01
  • 1970-01-01
  • 2018-03-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多