instance method
take_failed_screenshot
Ruby on Rails 6.0.6
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 included in application_system_test_case.rb that is generated with the application. To take screenshots when a test fails add take_failed_screenshot to the teardown block before clearing sessions.
Source
# File actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb, line 36
def take_failed_screenshot
take_screenshot if failed? && supports_screenshot?
end
Defined in actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb line 36
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper