我有一些可以从控制台运行的黄瓜测试
rake cucumber
是否有命令行选项可以将测试结果存储到文本文件中?
Either
-
Run cucumber
直接并使用-o
. From cucumber --help
:
-o, --out [FILE|DIR]
Write output to a file/directory instead of STDOUT. This option
applies to the previously specified --format, or the
default format if no format is specified. Check the specific
formatter's docs to see whether to pass a file or a dir.
-
Run rake
with CUCUMBER_OPTS="-o whateverfile"
, i.e.
CUCUMBER_OPTS="-o whateverfile" rake cucumber # assuming you're using a Bourne family shell
or
rake CUCUMBER_OPTS="-o whateverfile" cucumber
-
编辑 lib/tasks/cucumber.rake 并添加
t.cucumber_ops = '-o whateverfile'
到一个或多个Cucumber::Rake::Task
s
-
或者只是重定向输出cucumber
命令自己:
cucumber > whateverfile
-o
与重定向略有不同:它总是将“进度”输出打印到屏幕上。如果您不指定格式,它会将默认的“漂亮”格式放入文件中。如果你这样做(例如cucumber -f html -o whateverfile
)它将您指定的格式放入文件中。
如果重要的话,我正在使用 Ruby Cucumber 2.3.2。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)