capybara-screenshot-diff 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +7 -7
- data/.travis.yml +4 -7
- data/README.md +9 -1
- data/gemfiles/rails60.gemfile +1 -1
- data/lib/capybara/screenshot/diff/stabilization.rb +3 -3
- data/lib/capybara/screenshot/diff/test_methods.rb +6 -4
- data/lib/capybara/screenshot/diff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dc2b0fb0ecc0721b9a857dbd62e0136e156fac4392203fe43b09e8b92fed361
|
4
|
+
data.tar.gz: dc70029a9a9d8b66a7e499e3c8fc1d86e9cd313fcb207b9e9232cc1ad3ff3975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 146567ed853d61596d5e88705d5da091f36f8cfd8f2c1503f30cbd916dcf59af652471fd12999ba77ede4fb15fff40c931bd1eb7e391feca83f8eb4a84fc97ae
|
7
|
+
data.tar.gz: b0ac70b70be9577603253e21a591f4031897f2ef0b78bf470a5b6b0c942837aa454b9b0069f7a38578f0afbd3708d9958c790bb9bc345da240ffcdff637c05ea
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-
|
3
|
+
# on 2019-08-29 00:41:08 +0200 using RuboCop version 0.68.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -19,11 +19,11 @@ Metrics/BlockLength:
|
|
19
19
|
# Offense count: 1
|
20
20
|
# Configuration parameters: CountComments.
|
21
21
|
Metrics/ClassLength:
|
22
|
-
Max:
|
22
|
+
Max: 304
|
23
23
|
|
24
|
-
# Offense count:
|
24
|
+
# Offense count: 5
|
25
25
|
Metrics/CyclomaticComplexity:
|
26
|
-
Max:
|
26
|
+
Max: 17
|
27
27
|
|
28
28
|
# Offense count: 15
|
29
29
|
# Configuration parameters: CountComments, ExcludedMethods.
|
@@ -33,16 +33,16 @@ Metrics/MethodLength:
|
|
33
33
|
# Offense count: 1
|
34
34
|
# Configuration parameters: CountComments.
|
35
35
|
Metrics/ModuleLength:
|
36
|
-
Max:
|
36
|
+
Max: 107
|
37
37
|
|
38
38
|
# Offense count: 1
|
39
39
|
# Configuration parameters: CountKeywordArgs.
|
40
40
|
Metrics/ParameterLists:
|
41
41
|
Max: 7
|
42
42
|
|
43
|
-
# Offense count:
|
43
|
+
# Offense count: 5
|
44
44
|
Metrics/PerceivedComplexity:
|
45
|
-
Max:
|
45
|
+
Max: 17
|
46
46
|
|
47
47
|
# Offense count: 2
|
48
48
|
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
data/.travis.yml
CHANGED
@@ -2,12 +2,11 @@ language: ruby
|
|
2
2
|
sudo: false
|
3
3
|
cache: bundler
|
4
4
|
rvm:
|
5
|
-
- jruby-9.2.
|
5
|
+
- jruby-9.2.8.0
|
6
6
|
- ruby-2.6.3
|
7
7
|
- ruby-2.5.5
|
8
8
|
- ruby-2.4.6
|
9
|
-
-
|
10
|
-
- truffleruby-1.0.0-rc16
|
9
|
+
- truffleruby-19.2.0
|
11
10
|
|
12
11
|
gemfile:
|
13
12
|
- gemfiles/rails60.gemfile
|
@@ -20,14 +19,12 @@ env:
|
|
20
19
|
- JRUBY_OPTS="--dev --debug"
|
21
20
|
|
22
21
|
jdk:
|
23
|
-
-
|
22
|
+
- oraclejdk14
|
24
23
|
|
25
24
|
matrix:
|
26
25
|
fast_finish: true
|
27
26
|
exclude:
|
28
27
|
- rvm: ruby-2.4.6
|
29
28
|
gemfile: gemfiles/rails60.gemfile
|
30
|
-
- rvm: ruby-2.3.8
|
31
|
-
gemfile: gemfiles/rails60.gemfile
|
32
29
|
allow_failures:
|
33
|
-
- rvm: truffleruby-
|
30
|
+
- rvm: truffleruby-19.2.0
|
data/README.md
CHANGED
@@ -295,9 +295,17 @@ shot will be taken and compared to the first. This is repeated until two
|
|
295
295
|
subsequent screen shots are identical.
|
296
296
|
|
297
297
|
```ruby
|
298
|
-
Capybara::Screenshot.stability_time_limit = 0.
|
298
|
+
Capybara::Screenshot.stability_time_limit = 0.1
|
299
299
|
```
|
300
300
|
|
301
|
+
This can be overridden on a single screenshot:
|
302
|
+
|
303
|
+
```ruby
|
304
|
+
test 'stability_time_limit' do
|
305
|
+
visit '/'
|
306
|
+
screenshot 'index', stability_time_limit: 0.5
|
307
|
+
end
|
308
|
+
```
|
301
309
|
|
302
310
|
|
303
311
|
### Removing focus from the active element
|
data/gemfiles/rails60.gemfile
CHANGED
@@ -21,14 +21,14 @@ module Capybara
|
|
21
21
|
JS
|
22
22
|
|
23
23
|
def take_stable_screenshot(comparison, color_distance_limit:, shift_distance_limit:,
|
24
|
-
area_size_limit:, skip_area:)
|
24
|
+
area_size_limit:, skip_area:, stability_time_limit:)
|
25
25
|
blurred_input = prepare_page_for_screenshot
|
26
26
|
previous_file_name = comparison.old_file_name
|
27
27
|
screenshot_started_at = last_image_change_at = Time.now
|
28
28
|
1.step do |i|
|
29
29
|
take_right_size_screenshot(comparison)
|
30
30
|
|
31
|
-
break unless
|
31
|
+
break unless stability_time_limit
|
32
32
|
|
33
33
|
if comparison.quick_equal?
|
34
34
|
clean_stabilization_images(comparison.new_file_name)
|
@@ -42,7 +42,7 @@ module Capybara
|
|
42
42
|
color_distance_limit: color_distance_limit, shift_distance_limit: shift_distance_limit,
|
43
43
|
area_size_limit: area_size_limit, skip_area: skip_area)
|
44
44
|
if stabilization_comparison.quick_equal?
|
45
|
-
if (Time.now - last_image_change_at) >
|
45
|
+
if (Time.now - last_image_change_at) > stability_time_limit
|
46
46
|
clean_stabilization_images(comparison.new_file_name)
|
47
47
|
break
|
48
48
|
end
|
@@ -68,9 +68,10 @@ module Capybara
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# @return [Boolean] wether a screenshot was taken
|
71
|
-
def screenshot(name,
|
72
|
-
|
73
|
-
skip_area: Diff.skip_area
|
71
|
+
def screenshot(name, area_size_limit: Diff.area_size_limit,
|
72
|
+
color_distance_limit: Diff.color_distance_limit,
|
73
|
+
shift_distance_limit: Diff.shift_distance_limit, skip_area: Diff.skip_area,
|
74
|
+
stability_time_limit: Screenshot.stability_time_limit)
|
74
75
|
return unless Screenshot.active?
|
75
76
|
return if window_size_is_wrong?
|
76
77
|
|
@@ -92,7 +93,8 @@ module Capybara
|
|
92
93
|
take_stable_screenshot(comparison, color_distance_limit: color_distance_limit,
|
93
94
|
shift_distance_limit: shift_distance_limit,
|
94
95
|
area_size_limit: area_size_limit,
|
95
|
-
skip_area: skip_area
|
96
|
+
skip_area: skip_area,
|
97
|
+
stability_time_limit: stability_time_limit)
|
96
98
|
return unless comparison.old_file_exists?
|
97
99
|
|
98
100
|
(@test_screenshots ||= []) << [caller(1..1).first, name, comparison]
|
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: 1.
|
4
|
+
version: 1.2.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: 2019-08-
|
11
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|