【发布时间】:2019-09-17 17:50:30
【问题描述】:
我有一组 Ruby/Cucumber 测试。在 IDE 中运行时,所有测试都能成功运行。
当我使用此 CLI 命令执行测试时,测试会运行并生成测试报告。
$ cucumber --format progress --format html --out=features_report.html -r features --tags '@this or @that' features
我需要从 Rakefile 执行测试才能并行运行测试。我可以使用rake local 调用下面的 Rakefile 来运行它们
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 or @that' --out first.html --format HTML",
我明白了:
All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError)
生成测试报告的参数在 test_args 中的什么位置,它们是什么样的?
提前致谢。
【问题讨论】:
标签: ruby cucumber rakefile test-reporting