aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing/test_helpers
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2017-02-23 11:16:13 -0500
committerGitHub <noreply@github.com>2017-02-23 11:16:13 -0500
commit4734d23c74fb4193aafe7cb04256bb745680d97f (patch)
tree0f4f2009bce3b83666514d5cce0bd693057c4dc4 /actionpack/lib/action_dispatch/system_testing/test_helpers
parent039380e3eeb24ed17f1824183b94638f0cfff747 (diff)
parentebaf1e709fb64cf7bbddb8f539863c2f24c3d3d5 (diff)
downloadrails-4734d23c74fb4193aafe7cb04256bb745680d97f.tar.gz
rails-4734d23c74fb4193aafe7cb04256bb745680d97f.tar.bz2
rails-4734d23c74fb4193aafe7cb04256bb745680d97f.zip
Merge pull request #28125 from y-yagi/do_not_take_screenshots_when_test_skipped
Do not take screenshot when test skipped
Diffstat (limited to 'actionpack/lib/action_dispatch/system_testing/test_helpers')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb8
1 files changed, 6 insertions, 2 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 784005cb93..ddc961cf84 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,12 +22,12 @@ module ActionDispatch
# fails add +take_failed_screenshot+ to the teardown block before clearing
# sessions.
def take_failed_screenshot
- take_screenshot unless passed?
+ take_screenshot if failed?
end
private
def image_name
- passed? ? method_name : "failures_#{method_name}"
+ failed? ? "failures_#{method_name}" : method_name
end
def image_path
@@ -51,6 +51,10 @@ module ActionDispatch
def inline_base64(path)
Base64.encode64(path).gsub("\n", "")
end
+
+ def failed?
+ !passed? && !skipped?
+ end
end
end
end