在运行黄瓜耙任务时如何排除文件/目录? 我目前在我的方案文件夹中有两个具有不同功能的文件夹: 特征 方案 文件夹_1 first_feature.feature 文件夹_2 second_feature.feature 在这些内部

问题描述 投票:0回答:1

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

问题的部分是我已经搜索了Internet和Cucumber文档,并且找不到列出Cucumber_opts所有有效选项的任何地方。 如果有人甚至可以将我指向正确的方向以找到不同的可能性列表,那将不胜感激。
谢谢你
    

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文件夹中运行方案...

您必须创建
ruby tags cucumber rake
1个回答
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

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.