你如何标记一个黄瓜情景作为待定

我如何标记一个黄瓜scheme作为挂起,所以它不被视为通过计数?

Scenario: Guest should not see edit link # pending implementation 

我应该不能标记为待定?

我发现@wip标签的问题在于它不会使testing套件变成黄色。 它完全忽略了wip的function,你往往忘记它们的存在。 当情景被标记为@wip然后被遗忘时,这使我的团队陷入了后面。 我希望有一个更好的解决scheme。 我最好的是添加这个自定义步骤:

 Given /^PENDING/ do pending end 

而不是将一个真实的function标记为待处理的,我可以把这个消息放到一个消息中,像这样:

 Given PENDING: we need client input 

然后它显示如下:

 (::) pending steps (::) features/example.feature:15:in `Given PENDING: we need client input' 

等待暂停testing链,但它不能阻止黄瓜唠叨相同的情况下任何未定义的步骤。 此外,理想情况下失败和挂起的function会告诉您失败的场景的名称 ,但它们不会。

另一种可能性是@wip标签(工作正在进行)。 标记为@wip的场景默认情况下不会运行,只是在您明确请求它们时才运行。

 @wip Scenario: New product form should have some special field Given I still work on this feature 

这样,您可以从自动构build中排除一些场景,以便在处理该function时不会中断。

好吧,算出这一个。

如果在任何步骤文件中找不到scheme步骤,则将其标记为挂起。

 Scenario: New product form should have some special field Given joe is logged in as an user When on the new exercise page Then the select field should have some special field 

它甚至足以将未决步骤剔除。

 When /^on the new exercise page$/ do pending # express the regexp above with the code you wish you had end 

除了averell的回答,您可以在运行黄瓜时排除场景标签。

如果@todo@wip是要在正在处理的场景中使用的标记,或者只是标记待定场景,请运行以下function:

cucumber --tags ~@todo --tags ~@wip

如果你使用Guard做这样的事情:

 guard 'cucumber', :notification => true, :all_on_start => true, :cmd => "bundle exec cucumber", :cli => "--tags ~@todo --tags ~@wip" do watch(%r{^features/.+\.feature$}) watch(%r{^features/support/.+$}) { 'features' } watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' end end