Ruby Rakefile黄瓜检测报告

Ruby Rakefile黄瓜检测报告,ruby,cucumber,rakefile,test-reporting,Ruby,Cucumber,Rakefile,Test Reporting,我有一套Ruby/Cumber测试。在IDE中运行时,所有测试都会成功运行 当我使用此CLI命令执行测试时,将运行测试并生成测试报告 $cucumber--格式化进度--格式化html--out=features\u report.html--r features--tags'@this或@that'features 我需要从Rakefile执行测试,以便并行运行测试。我可以使用rakelocal desc 'Run the functional test suite locally' t

我有一套Ruby/Cumber测试。在IDE中运行时,所有测试都会成功运行

当我使用此CLI命令执行测试时,将运行测试并生成测试报告

$cucumber--格式化进度--格式化html--out=features\u report.html--r features--tags'@this或@that'features

我需要从Rakefile执行测试,以便并行运行测试。我可以使用
rakelocal


desc 'Run the functional test suite locally'
  task :local do

test_args = ["-n", '1', 
             "-o" "-t '@this or @that'",
             "--type", 
             "cucumber", 
             '--',
             '-f',
             'progress', 
             '--',
             'features',]

    ParallelTests::CLI.new.run(test_args)
  end
但是我不知道生成测试报告的额外选项/参数去了哪里

如果我将Rakefile中的报告位分组为工作CLI命令中的报告位

             'progress',
              '-f',
              'HTML', 
             '--out',
             'first.html',
我得到这个错误:

Error creating formatter: HTML (LoadError)
或者,如果我这样做,
“-o”“-t”“@this或@that'-out first.html--format html”

我明白了:

All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError)
生成测试报告的参数在test_参数中的什么位置?它们看起来像什么


提前感谢。

您可以在
cucumber.yml
文件中创建
profile
,并在profile下传递参数,如下所示

default:
  --no-source --no-color
  --format progress --format html --out=features_report.html
现在按原样运行rake任务,cucumber将从
cucumber.yml
文件中选取参数并生成报告