Method: ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper#take_failed_screenshot

Defined in:
actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb

#take_failed_screenshotObject

Takes a screenshot of the current page in the browser if the test failed.

take_failed_screenshot is called during system test teardown.



53
54
55
56
57
58
# 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
  [:failure_screenshot_path] = relative_image_path if Minitest::Runnable.method_defined?(:metadata)
end