pic*_*rdo 14 ruby-on-rails cucumber
即使在步骤定义失败之后,黄瓜也会继续执行,并且它不仅输出失败的步骤,还输出通过的步骤.我需要使用什么选项才能确保Cucumber在遇到失败步骤时立即停止执行?
这是我的cucumber.yml文件
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
autotest: <%= std_opts %> features --color
Run Code Online (Sandbox Code Playgroud)
Ken*_*yer 14
After do |s|
# Tell Cucumber to quit after this scenario is done - if it failed.
Cucumber.wants_to_quit = true if s.failed?
end
Run Code Online (Sandbox Code Playgroud)
推荐的方法是使用黄瓜钩.
从 Cucumber 2.1 开始,您可以传递 --fail-fast 标签。
它应该在第一个失败的场景中失败并跳过其余的场景。
此 PR 的一部分https://github.com/cucumber/cucumber-ruby/pull/906
| 归档时间: |
|
| 查看次数: |
5099 次 |
| 最近记录: |