capybara-screenshot-diff 1.10.1 → 1.10.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: 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
@@ -14,7 +14,7 @@ gem "ruby-vips", require: false
|
|
14
14
|
|
15
15
|
group :test do
|
16
16
|
gem "capybara", ">= 3.26"
|
17
|
-
gem
|
17
|
+
gem "mutex_m" # Needed for RubyMine debugging. Try removing it.
|
18
18
|
gem "minitest", require: false
|
19
19
|
gem "minitest-stub-const", require: false
|
20
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
|