instance method take_failed_screenshot

Ruby on Rails 7.1.6

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

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 44
        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 44 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper

Type at least 2 characters to search.

↑↓ navigate · open · esc close