Ruby on Rails: Cucumber: is there a way to auto 'show me the page' on a failed test?
Is there a way to automatically show me the page when a test fails, then exit, so that i can fix the test, before continuing.. maybe ad开发者_JS百科ding a @skip tag when I don't care if it fails?
Yes, the answer is a bit late, just shy of 1 year, but...
You can add this to the features/env.rb or another file inside features/support:
After do |scenario|
if scenario.respond_to?(:status) && scenario.status == :failed
$fail_count = $fail_count.to_i + 1
save_and_open_page if $fail_count <= 5
end
end
More here: blog with comments
精彩评论