aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2017-03-05 09:17:08 -0500
committerGitHub <noreply@github.com>2017-03-05 09:17:08 -0500
commitc21f71c7ef5682be89d94d58bc950e6412850c5d (patch)
tree5ef9a2cb4cac6954d11a2ced8e16ab8ca9637331 /actionpack/lib
parent0a7e91abbc201788f4711e52322420dcc9035fad (diff)
parent2ee4058cc5c9327ddc5bfecc05e625320dd166a1 (diff)
downloadrails-c21f71c7ef5682be89d94d58bc950e6412850c5d.tar.gz
rails-c21f71c7ef5682be89d94d58bc950e6412850c5d.tar.bz2
rails-c21f71c7ef5682be89d94d58bc950e6412850c5d.zip
Merge pull request #28264 from y-yagi/do_not_take_screenshot_if_driver_does_not_support_it
Do not take screenshot if driver does not support screenshot
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb b/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
index ddc961cf84..e37f6d02aa 100644
--- a/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
+++ b/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
@@ -22,7 +22,7 @@ module ActionDispatch
# fails add +take_failed_screenshot+ to the teardown block before clearing
# sessions.
def take_failed_screenshot
- take_screenshot if failed?
+ take_screenshot if failed? && supports_screenshot?
end
private
@@ -55,6 +55,10 @@ module ActionDispatch
def failed?
!passed? && !skipped?
end
+
+ def supports_screenshot?
+ page.driver.public_methods(false).include?(:save_screenshot)
+ end
end
end
end