capybara-screenshot-diff 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/gems.rb +2 -1
- data/lib/capybara/screenshot/diff/image_compare.rb +4 -0
- data/lib/capybara/screenshot/diff/reporters/default.rb +5 -1
- data/lib/capybara/screenshot/diff/test_methods.rb +2 -2
- data/lib/capybara/screenshot/diff/version.rb +1 -1
- data/lib/capybara_screenshot_diff/minitest.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffbb0b50c61fc1dcab03db91256897bed64caa09d65d37ee39765aec52e3d6fb
|
4
|
+
data.tar.gz: 1c762e2084bf2629eae25fb5e38792ce2232bdd62edbdbf1bff5381c074b3edd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz: '
|
6
|
+
metadata.gz: 97356f772b607b1ff67b146d1726baabbef696b362187c5aa5833657a4a443e8a6e8a30dedec49a07bda4d115e2a7a5c8482e4ba64a958072d1aaf6cd9dab8a3
|
7
|
+
data.tar.gz: '05880832a40006772c5fd72b28a4ebe9c28ca36ef49e70f132cab55acf1b97135bcd86bdb4d1b19893961fb344b0268d1c5d708354412c9c99efad03d3da85ab'
|
data/gems.rb
CHANGED
@@ -13,7 +13,8 @@ gem "oily_png", platform: :ruby, git: "https://github.com/wvanbergen/oily_png",
|
|
13
13
|
gem "ruby-vips", require: false
|
14
14
|
|
15
15
|
group :test do
|
16
|
-
gem
|
16
|
+
gem "capybara", ">= 3.26"
|
17
|
+
gem "mutex_m" # Needed for RubyMine debugging. Try removing it.
|
17
18
|
gem "minitest", require: false
|
18
19
|
gem "minitest-stub-const", require: false
|
19
20
|
gem "simplecov", require: false
|
@@ -39,7 +39,7 @@ module Capybara::Screenshot::Diff
|
|
39
39
|
.map { |image| driver.dimension(image).join("x") }
|
40
40
|
.join(" => ")
|
41
41
|
|
42
|
-
"
|
42
|
+
"Dimensions have changed: #{change_msg}\n#{base_image_path.to_path}\n#{image_path.to_path}"
|
43
43
|
end
|
44
44
|
|
45
45
|
def annotate_and_save_images
|
@@ -101,6 +101,10 @@ module Capybara::Screenshot::Diff
|
|
101
101
|
difference.comparison.new_image
|
102
102
|
end
|
103
103
|
|
104
|
+
def base_image_path
|
105
|
+
comparison.base_image_path
|
106
|
+
end
|
107
|
+
|
104
108
|
def image_path
|
105
109
|
comparison.new_image_path
|
106
110
|
end
|
@@ -158,13 +158,13 @@ module Capybara
|
|
158
158
|
# Cleanup after comparisons
|
159
159
|
if !result && comparison.base_image_path.exist?
|
160
160
|
FileUtils.mv(comparison.base_image_path, comparison.image_path, force: true)
|
161
|
-
|
161
|
+
elsif !comparison.dimensions_changed?
|
162
162
|
FileUtils.rm_rf(comparison.base_image_path)
|
163
163
|
end
|
164
164
|
|
165
165
|
return unless result
|
166
166
|
|
167
|
-
"Screenshot does not match for '#{name}' #{comparison.error_message}\n#{caller.join("\n")}"
|
167
|
+
"Screenshot does not match for '#{name}': #{comparison.error_message}\n#{caller.join("\n")}"
|
168
168
|
end
|
169
169
|
|
170
170
|
private
|
@@ -21,7 +21,7 @@ module CapybaraScreenshotDiff
|
|
21
21
|
|
22
22
|
def screenshot(*args, skip_stack_frames: 0, **opts)
|
23
23
|
assert_nothing_raised do
|
24
|
-
super(*args, skip_stack_frames: skip_stack_frames +
|
24
|
+
super(*args, skip_stack_frames: skip_stack_frames + 3, **opts)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|