first_feature.feature:
Feature: One
@tag1 @tag2
Scenario: Scenario 1
@tag3
Scenario: Scenario 2
second_feature.feature:
Feature: Two
@tag1 @tag4
Scenario: Scenario 3
这是一个问题:我有一个耙式任务,它可以完成我的方案,并使用tag @tag1运行所有内容。现在,在功能一号中包含方案1和功能2中的Sceanrio 3。在不更改任何标签或方案的情况下,我可以在耙子任务中添加任何东西以告诉它忽略某个文件/文件夹中的任何测试吗? 在上面的示例中,我希望我的Rake Task忽略它在Folder_2中找到的任何场景,因此,即使它具有 @tag1。 我当前的耙子任务:
Cucumber::Rake::Task.new(:all_tag_1) do |t|
tags = '--tags ~@wip --tags @tag1'
t.cucumber_opts = "--format html --out features/build_results/all_tag_1.html --format pretty #{tags} --format junit --out features/build_results/reports"
end
谢谢你
Cucumber::Rake::Task.new(:all_tag_1) do |t|
tags = '--tags ~@wip --tags @tag1'
t.cucumber_opts = "features/scenarios/folder_1 --format html --out features/build_results/all_tag_1.html --format pretty #{tags} --format junit --out features/build_results/reports"
end
此命令只能从功能/方案/文件夹_1文件夹中运行方案...
您必须创建
---
<%
std_opts = "--format progress features -r features --strict --publish-quiet".dup
std_opts << " --tags 'not @wip'"
std_opts << " --tags 'not @wip-jruby'" if defined?(JRUBY_VERSION)
wip_opts = "--color -r features".dup
if defined?(JRUBY_VERSION)
wip_opts << " --tags '@wip or @wip-jruby'"
else
wip_opts << " --tags @wip"
end
%>
default: <%= std_opts %> --tags "not @jruby" -e folder/to/exclude
windows_mri: <%= std_opts %> --tags "not @jruby" --tags "not @needs-many-fonts"
wip: --wip <%= wip_opts %> features
none: --format pretty