instance method take_failed_screenshot

Ruby on Rails 6.1.7.10

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 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 44
        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 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