capybara-screenshot-diff 0.8.2 → 0.9.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2120b8b0ac6dc51602035b78721b827f0cf46ff
|
4
|
+
data.tar.gz: da5976f808661db8cb1202b9220a93577f785c26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4c01c8b9fc384c468f3e01e1ee92c4a17fe53b42a60cbd3e6fc86b040d442fa936993ddc10b1043e3fc219bd225e3ccb87ada0749f3793695dca58bcaf5dadf
|
7
|
+
data.tar.gz: 84f94aea83761a7dc55ce972cb98cedc31c7c2db0806834048528fdf636c320d4d1a352afa82102a2334d3042ce6b3bd27adaacd6e881d8150d187e1cbfc975c
|
data/.rubocop_todo.yml
CHANGED
@@ -63,7 +63,7 @@ module Capybara
|
|
63
63
|
def take_stable_screenshot(comparison)
|
64
64
|
input = prepare_page_for_screenshot
|
65
65
|
previous_file_name = comparison.old_file_name
|
66
|
-
|
66
|
+
screenshot_started_at = last_image_change_at = Time.now
|
67
67
|
loop.with_index do |_x, i|
|
68
68
|
take_right_size_screenshot(comparison)
|
69
69
|
|
@@ -87,12 +87,12 @@ module Capybara
|
|
87
87
|
last_image_change_at = Time.now
|
88
88
|
end
|
89
89
|
|
90
|
-
assert (Time.now -
|
90
|
+
assert (Time.now - screenshot_started_at) < Capybara.default_max_wait_time,
|
91
91
|
"Could not get stable screenshot within #{Capybara.default_max_wait_time}s\n" \
|
92
92
|
"#{stabilization_images(comparison.new_file_name).join("\n")}"
|
93
93
|
end
|
94
94
|
|
95
|
-
previous_file_name = "#{comparison.new_file_name.chomp('.png')}_x#{i}.png~"
|
95
|
+
previous_file_name = "#{comparison.new_file_name.chomp('.png')}_x#{format('%02i', i)}.png~"
|
96
96
|
|
97
97
|
FileUtils.mv comparison.new_file_name, previous_file_name
|
98
98
|
end
|
@@ -95,8 +95,17 @@ module Capybara
|
|
95
95
|
|
96
96
|
def assert_image_not_changed(caller, name, comparison)
|
97
97
|
return unless comparison.different?
|
98
|
+
|
99
|
+
# TODO(uwe): Remove check when we stop supporting Ruby 2.3 and older
|
100
|
+
max_color_distance = if RUBY_VERSION >= '2.4'
|
101
|
+
comparison.max_color_distance.ceil(1)
|
102
|
+
else
|
103
|
+
comparison.max_color_distance.ceil
|
104
|
+
end
|
105
|
+
# ODOT
|
106
|
+
|
98
107
|
"Screenshot does not match for '#{name}' (area: #{comparison.size}px #{comparison.dimensions}" \
|
99
|
-
", max_color_distance: #{
|
108
|
+
", max_color_distance: #{max_color_distance})\n" \
|
100
109
|
"#{comparison.new_file_name}\n#{comparison.annotated_old_file_name}\n" \
|
101
110
|
"#{comparison.annotated_new_file_name}\n" \
|
102
111
|
"at #{caller}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-screenshot-diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uwe Kubosch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|