capybara-screenshot-diff 1.9.2 → 1.10.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b035794cdcf21a354847ddc368d0eeedade734ee20c42f68552baaab5e10adce
|
4
|
+
data.tar.gz: 52053bf5f927c67478b1b5532e42fbaba493000196d55cad9e7f9229207ff9d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf40f14eff9443d32aa8e179f97e33f4c36e4ad16a0fa49a23ebbfd50056b916bf74bdd1f64ac4cacf19b2ed1aaf6d948851879b5c814cae4701d94ee5d68287
|
7
|
+
data.tar.gz: '096e47818809b8f8cbca41b77b0044c0a91aa449e635315f090f74325be46a868ae3ee2958b518a29b59f294e9173c46ce4c4bb901349ffea46a2afc7edad0c8'
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = "Track your GUI changes with diff assertions"
|
13
13
|
spec.description = "Save screen shots and track changes with graphical diff"
|
14
14
|
spec.homepage = "https://github.com/donv/capybara-screenshot-diff"
|
15
|
-
spec.required_ruby_version = ">= 3.
|
15
|
+
spec.required_ruby_version = ">= 3.1"
|
16
16
|
spec.license = "MIT"
|
17
17
|
spec.metadata["allowed_push_host"] = "https://rubygems.org/"
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_runtime_dependency "actionpack", ">=
|
26
|
+
spec.add_runtime_dependency "actionpack", ">= 7.0", "< 9"
|
27
27
|
spec.add_runtime_dependency "capybara", ">= 2", "< 4"
|
28
28
|
end
|
data/gems.rb
CHANGED
@@ -12,11 +12,13 @@ gem "chunky_png", ">= 1.3", require: false
|
|
12
12
|
gem "oily_png", platform: :ruby, git: "https://github.com/wvanbergen/oily_png", ref: "44042006e79efd42ce4b52c1d78a4c70f0b4b1b2"
|
13
13
|
gem "ruby-vips", require: false
|
14
14
|
|
15
|
-
|
16
|
-
gem
|
17
|
-
gem "minitest
|
18
|
-
gem "
|
19
|
-
gem "
|
15
|
+
group :test do
|
16
|
+
gem 'mutex_m' # Needed for RubyMine
|
17
|
+
gem "minitest", require: false
|
18
|
+
gem "minitest-stub-const", require: false
|
19
|
+
gem "simplecov", require: false
|
20
|
+
gem "rspec", require: false
|
21
|
+
end
|
20
22
|
|
21
23
|
# Capybara Server
|
22
24
|
gem "puma", require: false
|
@@ -123,9 +123,10 @@ module Capybara
|
|
123
123
|
screenshot_full_name = build_full_name(name)
|
124
124
|
job = build_screenshot_matches_job(screenshot_full_name, options)
|
125
125
|
|
126
|
+
caller = caller(skip_stack_frames + 1).reject { |l| l =~ /gems\/(activesupport|minitest|railties)/ }
|
126
127
|
unless job
|
127
128
|
if Screenshot::Diff.fail_if_new
|
128
|
-
|
129
|
+
_raise_error(<<-ERROR.strip_heredoc, caller)
|
129
130
|
No existing screenshot found for #{screenshot_full_name}!
|
130
131
|
To stop seeing this error disable by `Capybara::Screenshot::Diff.fail_if_new=false`
|
131
132
|
ERROR
|
@@ -134,13 +135,13 @@ module Capybara
|
|
134
135
|
return false
|
135
136
|
end
|
136
137
|
|
137
|
-
job.prepend(caller
|
138
|
+
job.prepend(caller)
|
138
139
|
|
139
140
|
if Screenshot::Diff.delayed
|
140
141
|
schedule_match_job(job)
|
141
142
|
else
|
142
143
|
error_msg = assert_image_not_changed(*job)
|
143
|
-
|
144
|
+
_raise_error(error_msg, caller(2)) if error_msg
|
144
145
|
end
|
145
146
|
end
|
146
147
|
|
@@ -163,12 +164,12 @@ module Capybara
|
|
163
164
|
|
164
165
|
return unless result
|
165
166
|
|
166
|
-
"Screenshot does not match for '#{name}' #{comparison.error_message}\n#{caller.join("
|
167
|
+
"Screenshot does not match for '#{name}' #{comparison.error_message}\n#{caller.join("\n")}"
|
167
168
|
end
|
168
169
|
|
169
170
|
private
|
170
171
|
|
171
|
-
def
|
172
|
+
def _raise_error(error_msg, backtrace)
|
172
173
|
raise CapybaraScreenshotDiff::ExpectationNotMet.new(error_msg).tap { _1.set_backtrace(backtrace) }
|
173
174
|
end
|
174
175
|
|
@@ -19,10 +19,10 @@ module CapybaraScreenshotDiff
|
|
19
19
|
module Assertions
|
20
20
|
include ::CapybaraScreenshotDiff::DSL
|
21
21
|
|
22
|
-
def screenshot(
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def screenshot(*args, skip_stack_frames: 0, **opts)
|
23
|
+
assert_nothing_raised do
|
24
|
+
super(*args, skip_stack_frames: skip_stack_frames + 1, **opts)
|
25
|
+
end
|
26
26
|
end
|
27
27
|
|
28
28
|
alias_method :assert_matches_screenshot, :screenshot
|
@@ -37,7 +37,11 @@ module CapybaraScreenshotDiff
|
|
37
37
|
klass.teardown do
|
38
38
|
errors = verify_screenshots!(@test_screenshots)
|
39
39
|
|
40
|
-
|
40
|
+
if errors.present?
|
41
|
+
assertion = ::Minitest::Assertion.new(errors.join("\n\n"))
|
42
|
+
assertion.set_backtrace []
|
43
|
+
failures << assertion
|
44
|
+
end
|
41
45
|
end
|
42
46
|
end
|
43
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
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.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uwe Kubosch
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date: 2024-
|
10
|
+
date: 2024-12-31 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: actionpack
|
@@ -16,7 +15,7 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
18
|
+
version: '7.0'
|
20
19
|
- - "<"
|
21
20
|
- !ruby/object:Gem::Version
|
22
21
|
version: '9'
|
@@ -26,7 +25,7 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
28
|
+
version: '7.0'
|
30
29
|
- - "<"
|
31
30
|
- !ruby/object:Gem::Version
|
32
31
|
version: '9'
|
@@ -96,7 +95,6 @@ licenses:
|
|
96
95
|
- MIT
|
97
96
|
metadata:
|
98
97
|
allowed_push_host: https://rubygems.org/
|
99
|
-
post_install_message:
|
100
98
|
rdoc_options: []
|
101
99
|
require_paths:
|
102
100
|
- lib
|
@@ -104,15 +102,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
102
|
requirements:
|
105
103
|
- - ">="
|
106
104
|
- !ruby/object:Gem::Version
|
107
|
-
version: 3.
|
105
|
+
version: '3.1'
|
108
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
107
|
requirements:
|
110
108
|
- - ">="
|
111
109
|
- !ruby/object:Gem::Version
|
112
110
|
version: '0'
|
113
111
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
112
|
+
rubygems_version: 3.6.2
|
116
113
|
specification_version: 4
|
117
114
|
summary: Track your GUI changes with diff assertions
|
118
115
|
test_files: []
|