本文介绍了你如何让黄瓜/警卫过滤像@wip的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行spork和guard,所有的一切都进行得很好,我的RSpec测试,都运行正常。为了加快测试速度,我可以成功地过滤我的RSpec测试,我放在我的 .rspec 文件中。

I'm running spork and guard and all has been going very well with my RSpec tests which were all run correctly. In order to speed up the tests I could successfully filter my RSpec tests with tags I placed in my .rspec file.

.rspec

--colour
--debug
--tag focus
--tag now

不幸的是,我无法过滤黄瓜标签。每次黄瓜运行它运行一切或只是改变的文件。

Unfortunately though I have not been able to filter my cucumber tags. Every time cucumber runs it runs either everything or just the file that changed.

如何获取黄瓜/猪肉/猪圈以尊重像@wip,@now等标签,只运行那些测试?是否有一些等同于 .rspec 的黄瓜标签文件?

How can I get cucumber/spork/guard to respect tags like @wip, @now etc and run only those tests? Is there some equivalent to the .rspec file for cucumber tags?

推荐答案

您可以使用黄瓜配置文件定义要执行的标签。使用YML文件,您可以定义执行@wip标签的配置文件:

You could use a cucumber profile to define the tags that you want to execute. Using the YML file, you can define a profile that execute your @wip tags:

wip: --tags @wip

更多信息:

您也可以从命令行运行cucumber,并传递-t参数:

You can also just run cucumber from the command line and pass it the -t argument:

cucumber -t @wip,@now



从帮助(黄瓜-h):

From the help (cucumber -h):

因此,理论上我们可以使用guardfile这些选项:

Hence, in theory we can use the guardfile with these options:

guard 'cucumber', :cli => "--drb --tags @now" do
  watch(%r{^features/.+\.feature$})
  ...
end

这篇关于你如何让黄瓜/警卫过滤像@wip的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 18:07