capybara-screenshot will take screenshot if no element found using find.
find('something that does not exist').click
But if no element found using within, it does not take any screenshot.
within('something that does not exist') do
# do something
end
From my Gemfile.lock, i am using latest version of Capybara, 1.0.11. I am using latest RSpec version, 3.4.