使用以下命令在黄瓜中使用 Ruby gem Parallel_Tests 运行多个功能时:
parallel_cucumber features/
在我的项目 root>config 文件夹下有一个 cucumber.yml 文件,如下所示:
default: --format html --out report<%= ENV['TEST_ENV_NUMBER'] %>.html
我收到以下错误消息:
cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.
我已经对此进行了调查,其他一些人认为这是由于 rerun.txt 文件造成的,但我没有创建此文件,项目文件搜索没有返回任何内容。我目前不知道是什么导致黄瓜无法读取 yaml 文件。任何帮助都会很棒。
正如另一篇文章所述,我进入 lib/cucumber/cli/profile_loader.rb 并添加了一个 STDERR 输出,如下所示:
begin
@cucumber_yml = YAML::load(@cucumber_erb)
rescue StandardError => e
STDERR.puts @cucumber_erb
raise(YmlLoadError,"cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.\n")
end
结果如下:
#parallel_reports: --format html --out reports/cukes_.html
cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.
#
default: --format htm#l
-
oduetf aruelpto:r t-2-.fhotrmmla #hptamrla l-l-eolu_tr erpeoprotrst:4 .-h-tfmolr a#tp ahrtamlll e-l-_oruetp orretpso:r t-s-/fcourkmeast_ .hhttmmll - ouctu cruempboerrt.sy/mclu kweass_ .fhotumnld, buctu ccuomubledr .nyomtl bwea sp afrosuendd., Pblueta sceo urledf enro tt ob ec upcaurmsbeedr.' sP ldeoacsuem ernetfaetri otno ocnu ccuomrbreerc'ts pdroocfuimleen tu astaigoen.
n correct profile usage.