instance method
take_failed_screenshot
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
take_failed_screenshot()
Takes a screenshot of the current page in the browser if the test failed.
take_failed_screenshot is called during system test teardown.
Source
# File actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb, line 53
def take_failed_screenshot
return unless failed? && supports_screenshot? && Capybara::Session.instance_created?
take_screenshot
metadata[:failure_screenshot_path] = relative_image_path if Minitest::Runnable.method_defined?(:metadata)
end
Defined in actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb line 53
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper