Capybara screenshot doesn't take snapshot while step fails. I am using below code:
Capybara.save_and_open_page_path = "/file/path"
Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
"screenshot_#{example.description.gsub(' ', '-').gsub(/^.*\/spec\//,'')}"
end
I saw it takes screenshots after whole scenario ends but not on the step fails. I want screenshots while steps are failing... Please help