capybara-screenshot-diff 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ace795ddf840ec95a7b217509b7ab9b510e70eb9711358b98aade93ebaf7617a
|
4
|
+
data.tar.gz: d4b5bef585802d7f90ac13237337c041e5b02ec996509e075245ba0e7fc76cf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db81714ed5e680cce7d14ace467ed21c46a776e55350fcf3e3a8c1d3c9a1f6cbb866213383f5284089725804431544861f43ca43c7edcda37b75e5bdbe53beef
|
7
|
+
data.tar.gz: c2850fa792d957908b3b2e5a937807d31e8b30566b40c7ad403b3d63eede4c023e9f6205f9f513a5e723f5ab889a357e1ad5792028ffd43ee78ceb93ca74dee3
|
@@ -74,12 +74,12 @@ module Capybara
|
|
74
74
|
|
75
75
|
return false unless job
|
76
76
|
|
77
|
-
|
77
|
+
job.prepend(caller[skip_stack_frames])
|
78
78
|
|
79
79
|
if Screenshot::Diff.delayed
|
80
|
-
schedule_match_job(
|
80
|
+
schedule_match_job(job)
|
81
81
|
else
|
82
|
-
error_msg = assert_image_not_changed(job
|
82
|
+
error_msg = assert_image_not_changed(*job)
|
83
83
|
if error_msg
|
84
84
|
error = ASSERTION.new(error_msg)
|
85
85
|
error.set_backtrace(caller(2))
|
@@ -88,7 +88,7 @@ module Capybara
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
def assert_image_not_changed(name, comparison)
|
91
|
+
def assert_image_not_changed(caller, name, comparison)
|
92
92
|
result = comparison.different?
|
93
93
|
|
94
94
|
# Cleanup after comparisons
|
@@ -100,7 +100,7 @@ module Capybara
|
|
100
100
|
|
101
101
|
return unless result
|
102
102
|
|
103
|
-
"Screenshot does not match for '#{name}' #{comparison.error_message}"
|
103
|
+
"Screenshot does not match for '#{name}' #{comparison.error_message}\n#{caller}"
|
104
104
|
end
|
105
105
|
|
106
106
|
private
|
@@ -80,7 +80,7 @@ module Capybara
|
|
80
80
|
|
81
81
|
klass.teardown do
|
82
82
|
if Screenshot.active? && @test_screenshots.present?
|
83
|
-
track_failures(@test_screenshots
|
83
|
+
track_failures(@test_screenshots)
|
84
84
|
@test_screenshots.clear
|
85
85
|
end
|
86
86
|
end
|
@@ -90,16 +90,16 @@ module Capybara
|
|
90
90
|
|
91
91
|
EMPTY_LINE = "\n\n"
|
92
92
|
|
93
|
-
def track_failures(screenshots
|
93
|
+
def track_failures(screenshots)
|
94
94
|
test_screenshot_errors = screenshots.map do |caller, name, compare|
|
95
|
-
assert_image_not_changed(name, compare)
|
95
|
+
assert_image_not_changed(caller, name, compare)
|
96
96
|
end
|
97
97
|
|
98
98
|
test_screenshot_errors.compact!
|
99
99
|
|
100
100
|
unless test_screenshot_errors.empty?
|
101
101
|
error = ASSERTION.new(test_screenshot_errors.join(EMPTY_LINE))
|
102
|
-
error.set_backtrace(
|
102
|
+
error.set_backtrace([])
|
103
103
|
|
104
104
|
if is_a?(::Minitest::Runnable)
|
105
105
|
failures << error
|
@@ -28,7 +28,7 @@ module Capybara
|
|
28
28
|
|
29
29
|
def screenshot: (name_entity name, ?skip_stack_frames: ::Integer, **untyped options) -> boolish
|
30
30
|
|
31
|
-
def assert_image_not_changed: (String name, ImageCompare comparison) -> ::String?
|
31
|
+
def assert_image_not_changed: (String caller, String name, ImageCompare comparison) -> ::String?
|
32
32
|
|
33
33
|
private
|
34
34
|
|