capybara-screenshot-diff 0.15.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -1
- data/.travis.yml +16 -8
- data/Gemfile +2 -0
- data/README.md +3 -3
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/capybara-screenshot-diff.gemspec +5 -2
- data/gemfiles/common.gemfile +3 -0
- data/gemfiles/rails42.gemfile +2 -0
- data/gemfiles/rails50.gemfile +2 -0
- data/gemfiles/rails51.gemfile +2 -0
- data/gemfiles/rails52.gemfile +2 -0
- data/gemfiles/rails60.gemfile +5 -0
- data/lib/capybara/screenshot/diff.rb +4 -2
- data/lib/capybara/screenshot/diff/image_compare.rb +2 -0
- data/lib/capybara/screenshot/diff/os.rb +2 -0
- data/lib/capybara/screenshot/diff/stabilization.rb +3 -1
- data/lib/capybara/screenshot/diff/test_methods.rb +2 -0
- data/lib/capybara/screenshot/diff/vcs.rb +2 -0
- data/lib/capybara/screenshot/diff/version.rb +1 -1
- data/matrix_test.rb +13 -8
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ed4cf559968821a2689708d36fe556f97b9f0c730a09ab39ca05f1b991ca8ea
|
4
|
+
data.tar.gz: 4749b6bec782a95edd8fe51ec6d216c505fb0b606769738cb0192f37480c67c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ce1837fa5049d423afad82daa6b0c589d1cf2670da9268584b9c16ce589abb7a91fd4d11601c0639037da102754e8a5696d9e143949074354f70ffca38e8499
|
7
|
+
data.tar.gz: 1d3df4ef083b2980e31f59d15b783c9fd26474a1a550f5c8c4d5405abf523bab798b0f21fa246c2b872053dddf79d72c21bb52d412aaa8b40fd6fb23dfca2b96
|
data/.rubocop.yml
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
|
+
require: rubocop-performance
|
2
3
|
|
3
4
|
AllCops:
|
4
|
-
TargetRubyVersion: 2.
|
5
|
+
TargetRubyVersion: 2.3
|
5
6
|
DisplayCopNames: true
|
6
7
|
DisplayStyleGuide: true
|
7
8
|
Exclude:
|
8
9
|
- gemfiles/vendor/**/*
|
9
10
|
|
11
|
+
Layout/AlignArguments:
|
12
|
+
EnforcedStyle: with_fixed_indentation
|
13
|
+
IndentationWidth: 4
|
14
|
+
|
10
15
|
Layout/AlignParameters:
|
11
16
|
EnforcedStyle: with_fixed_indentation
|
12
17
|
IndentationWidth: 4
|
data/.travis.yml
CHANGED
@@ -2,12 +2,15 @@ language: ruby
|
|
2
2
|
sudo: false
|
3
3
|
cache: bundler
|
4
4
|
rvm:
|
5
|
-
- jruby-9.2.
|
6
|
-
- ruby-2.
|
7
|
-
- ruby-2.
|
8
|
-
- ruby-2.
|
5
|
+
- jruby-9.2.7.0
|
6
|
+
- ruby-2.6.3
|
7
|
+
- ruby-2.5.5
|
8
|
+
- ruby-2.4.6
|
9
|
+
- ruby-2.3.8
|
10
|
+
- truffleruby-1.0.0-rc16
|
9
11
|
|
10
12
|
gemfile:
|
13
|
+
- gemfiles/rails60.gemfile
|
11
14
|
- gemfiles/rails52.gemfile
|
12
15
|
- gemfiles/rails51.gemfile
|
13
16
|
- gemfiles/rails50.gemfile
|
@@ -19,7 +22,12 @@ env:
|
|
19
22
|
jdk:
|
20
23
|
- oraclejdk8
|
21
24
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
25
|
+
matrix:
|
26
|
+
fast_finish: true
|
27
|
+
exclude:
|
28
|
+
- rvm: ruby-2.4.6
|
29
|
+
gemfile: gemfiles/rails60.gemfile
|
30
|
+
- rvm: ruby-2.3.8
|
31
|
+
gemfile: gemfiles/rails60.gemfile
|
32
|
+
allow_failures:
|
33
|
+
- rvm: truffleruby-1.0.0-rc16
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -12,11 +12,11 @@ taking screen shots and comparing them to the previous revision.
|
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
15
|
-
Add
|
15
|
+
Add these lines to your application's Gemfile:
|
16
16
|
|
17
17
|
```ruby
|
18
18
|
gem 'capybara-screenshot-diff'
|
19
|
-
gem 'oily_png', platform :ruby
|
19
|
+
gem 'oily_png', platform: :ruby
|
20
20
|
```
|
21
21
|
|
22
22
|
And then execute:
|
@@ -145,7 +145,7 @@ end
|
|
145
145
|
test 'my subfeature' do
|
146
146
|
screenshot_group 'subfeature'
|
147
147
|
visit '/feature'
|
148
|
-
click_button '
|
148
|
+
click_button 'Interesting button'
|
149
149
|
screenshot 'subfeature_index'
|
150
150
|
click_button 'Perform action'
|
151
151
|
screenshot 'action_performed'
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'capybara/screenshot/diff/version'
|
@@ -10,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
10
12
|
spec.summary = 'Track your GUI changes with diff assertions'
|
11
13
|
spec.description = 'Save screen shots and track changes with graphical diff'
|
12
14
|
spec.homepage = 'https://github.com/donv/capybara-screenshot-diff'
|
13
|
-
spec.required_ruby_version = '~> 2.
|
15
|
+
spec.required_ruby_version = '~> 2.3'
|
14
16
|
spec.license = 'MIT'
|
15
17
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
|
16
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -18,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
18
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
21
|
spec.require_paths = ['lib']
|
20
22
|
|
21
|
-
spec.add_runtime_dependency 'actionpack', '>= 4.2', '<
|
23
|
+
spec.add_runtime_dependency 'actionpack', '>= 4.2', '< 7'
|
22
24
|
spec.add_runtime_dependency 'capybara', '>= 2', '< 4'
|
23
25
|
spec.add_runtime_dependency 'chunky_png', '~> 1.3'
|
24
26
|
|
@@ -27,5 +29,6 @@ Gem::Specification.new do |spec|
|
|
27
29
|
spec.add_development_dependency 'minitest-reporters'
|
28
30
|
spec.add_development_dependency 'rake'
|
29
31
|
spec.add_development_dependency 'rubocop', '~> 0.54'
|
32
|
+
spec.add_development_dependency 'rubocop-performance', '~> 0.0'
|
30
33
|
spec.add_development_dependency 'simplecov', '~> 0.11'
|
31
34
|
end
|
data/gemfiles/common.gemfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gem 'capybara', '~> 2.0'
|
@@ -6,4 +8,5 @@ gem 'minitest', '~> 5.0'
|
|
6
8
|
gem 'minitest-reporters'
|
7
9
|
gem 'rake'
|
8
10
|
gem 'rubocop', '~> 0.39'
|
11
|
+
gem 'rubocop-performance', '~> 0.0'
|
9
12
|
gem 'simplecov', '~> 0.11'
|
data/gemfiles/rails42.gemfile
CHANGED
data/gemfiles/rails50.gemfile
CHANGED
data/gemfiles/rails51.gemfile
CHANGED
data/gemfiles/rails52.gemfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'capybara/dsl'
|
2
4
|
require 'capybara/screenshot/diff/version'
|
3
5
|
require 'capybara/screenshot/diff/image_compare'
|
@@ -29,7 +31,7 @@ module Capybara
|
|
29
31
|
end
|
30
32
|
|
31
33
|
def screenshot_area_abs
|
32
|
-
"#{root}/#{screenshot_area}"
|
34
|
+
"#{root}/#{screenshot_area}"
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
@@ -58,7 +60,7 @@ module Capybara
|
|
58
60
|
clas.teardown do
|
59
61
|
if Capybara::Screenshot::Diff.enabled && @test_screenshots
|
60
62
|
test_screenshot_errors = @test_screenshots
|
61
|
-
.map { |caller, name, compare| assert_image_not_changed(caller, name, compare) }.compact
|
63
|
+
.map { |caller, name, compare| assert_image_not_changed(caller, name, compare) }.compact!
|
62
64
|
fail(test_screenshot_errors.join("\n\n")) if test_screenshot_errors.any?
|
63
65
|
end
|
64
66
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'os'
|
2
4
|
|
3
5
|
module Capybara
|
@@ -58,7 +60,7 @@ module Capybara
|
|
58
60
|
FileUtils.mv comparison.new_file_name, previous_file_name
|
59
61
|
end
|
60
62
|
ensure
|
61
|
-
blurred_input
|
63
|
+
blurred_input&.click
|
62
64
|
end
|
63
65
|
|
64
66
|
private
|
data/matrix_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby -w
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
system('rubocop --auto-correct') || exit(1)
|
4
5
|
|
@@ -15,21 +16,27 @@ def run_script(ruby, env, gemfile)
|
|
15
16
|
puts "Testing #{ruby} #{gemfile} #{env}"
|
16
17
|
puts
|
17
18
|
system("chruby-exec #{ruby} -- bundle exec rake") || exit(1)
|
19
|
+
puts "Testing #{ruby} #{gemfile} OK"
|
18
20
|
puts '*' * 80
|
19
21
|
end
|
20
22
|
|
21
23
|
def use_gemfile(ruby, gemfile, update_gemfiles)
|
22
24
|
puts '$' * 80
|
23
|
-
puts "Testing #{gemfile}"
|
24
|
-
puts
|
25
25
|
ENV['BUNDLE_GEMFILE'] = gemfile
|
26
|
+
|
27
|
+
bundler_version = `grep -A1 "BUNDLED WITH" #{gemfile}.lock | tail -n 1`
|
28
|
+
bundler_version = '~> 2.0' if bundler_version.strip.empty?
|
29
|
+
|
30
|
+
version_arg = "-v '#{bundler_version}'"
|
31
|
+
bundler_gem_check_cmd = "chruby-exec #{ruby} -- gem query -i -n bundler #{version_arg} >/dev/null"
|
32
|
+
system "#{bundler_gem_check_cmd} || chruby-exec #{ruby} -- gem install #{version_arg} bundler" || exit(1)
|
33
|
+
|
26
34
|
if update_gemfiles
|
27
35
|
system "chruby-exec #{ruby} -- bundle update"
|
28
36
|
else
|
29
|
-
system "chruby-exec #{ruby} -- bundle check || chruby-exec #{ruby} -- bundle install"
|
37
|
+
system "chruby-exec #{ruby} -- bundle check >/dev/null || chruby-exec #{ruby} -- bundle install"
|
30
38
|
end || exit(1)
|
31
39
|
yield
|
32
|
-
puts "Testing #{gemfile} OK"
|
33
40
|
puts '$' * 80
|
34
41
|
end
|
35
42
|
|
@@ -40,12 +47,10 @@ travis['rvm'].each do |ruby|
|
|
40
47
|
puts "Testing #{ruby}"
|
41
48
|
puts
|
42
49
|
system "ruby-install --no-reinstall #{ruby}" || exit(1)
|
43
|
-
bundler_gem_check_cmd = "chruby-exec #{ruby} -- gem query -i -n bundler >/dev/null"
|
44
|
-
system "#{bundler_gem_check_cmd} || chruby-exec #{ruby} -- gem install bundler" || exit(1)
|
45
50
|
travis['gemfile'].each do |gemfile|
|
46
51
|
if travis['matrix'] &&
|
47
|
-
(travis['matrix']['exclude'].to_a + travis['matrix']['
|
48
|
-
.any? { |f| f['rvm'] == ruby && f['gemfile'] == gemfile }
|
52
|
+
(travis['matrix']['exclude'].to_a + travis['matrix']['allow_failures'].to_a)
|
53
|
+
.any? { |f| f['rvm'] == ruby && (f['gemfile'].nil? || f['gemfile'] == gemfile) }
|
49
54
|
puts 'Skipping known failure.'
|
50
55
|
next
|
51
56
|
end
|
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: 1.0.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-
|
11
|
+
date: 2019-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '4.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '4.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: capybara
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,6 +134,20 @@ dependencies:
|
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0.54'
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: rubocop-performance
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0.0'
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0.0'
|
137
151
|
- !ruby/object:Gem::Dependency
|
138
152
|
name: simplecov
|
139
153
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,6 +186,7 @@ files:
|
|
172
186
|
- gemfiles/rails50.gemfile
|
173
187
|
- gemfiles/rails51.gemfile
|
174
188
|
- gemfiles/rails52.gemfile
|
189
|
+
- gemfiles/rails60.gemfile
|
175
190
|
- lib/capybara/screenshot/diff.rb
|
176
191
|
- lib/capybara/screenshot/diff/image_compare.rb
|
177
192
|
- lib/capybara/screenshot/diff/os.rb
|
@@ -193,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
193
208
|
requirements:
|
194
209
|
- - "~>"
|
195
210
|
- !ruby/object:Gem::Version
|
196
|
-
version: '2.
|
211
|
+
version: '2.3'
|
197
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
213
|
requirements:
|
199
214
|
- - ">="
|