capybara-screenshot-diff 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -1
- data/README.md +37 -0
- data/lib/capybara/screenshot/diff.rb +1 -1
- data/lib/capybara/screenshot/diff/image_compare.rb +4 -0
- data/lib/capybara/screenshot/diff/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85d1673c71c3656cae04ccb2ef3064af14f8f399
|
4
|
+
data.tar.gz: ade0e18548afcf5d1701f329c724722d4d4359f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9693765e3bf37e1bf7d1a10649ea20e9ae604fdf188a33c87f918341459b27740062fd6075b9ce0438c142ec2723c5f50077e9282ae911608f5c75c9b4b8dce1
|
7
|
+
data.tar.gz: 06c41cd6bec74485d4448b84d877e0f1e90ff227888b2adf09210cbc1a9d757a34a2da3c479d7c26f07d3b701643b0db349a72aa6bc9ff7a9ce771f19c368192
|
data/.rubocop_todo.yml
CHANGED
data/README.md
CHANGED
@@ -28,6 +28,43 @@ Or install it yourself as:
|
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
31
|
+
### Minitest
|
32
|
+
|
33
|
+
In your test class, include the `Capybara::Screenshot::Diff` module:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
class FeatureTest < ActionDispatch::IntegrationTest
|
37
|
+
include Capybara::Screenshot::Diff
|
38
|
+
...
|
39
|
+
end
|
40
|
+
```
|
41
|
+
|
42
|
+
or if you use the integration test directly:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
class ActionDispatch::IntegrationTest
|
46
|
+
include Capybara::Screenshot::Diff
|
47
|
+
...
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
### rspec
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
describe 'Permissions admin', :type => :feature, :js => true do
|
55
|
+
|
56
|
+
include Capybara::Screenshot::Diff
|
57
|
+
|
58
|
+
it 'works with permissions' do
|
59
|
+
visit('/')
|
60
|
+
screenshot 'home_page'
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
```
|
65
|
+
|
66
|
+
### Taking screenshots
|
67
|
+
|
31
68
|
Add `screenshot '<my_feature>'` to your tests. The screenshot will be saved in
|
32
69
|
the `doc/screenshots` directory.
|
33
70
|
|
@@ -21,7 +21,7 @@ module Capybara
|
|
21
21
|
|
22
22
|
def screenshot_area
|
23
23
|
parts = ['doc/screenshots']
|
24
|
-
parts << Capybara.
|
24
|
+
parts << Capybara.current_driver.to_s if Capybara::Screenshot.add_driver_path
|
25
25
|
parts << os_name if Capybara::Screenshot.add_os_path
|
26
26
|
File.join parts
|
27
27
|
end
|
@@ -78,6 +78,10 @@ module Capybara
|
|
78
78
|
|
79
79
|
if sizes_changed?(old_img, new_img)
|
80
80
|
save_images(@annotated_new_file_name, new_img, @annotated_old_file_name, old_img)
|
81
|
+
@left = 0
|
82
|
+
@top = 0
|
83
|
+
@right = old_img.dimension.width - 1
|
84
|
+
@bottom = old_img.dimension.height - 1
|
81
85
|
return true
|
82
86
|
end
|
83
87
|
|
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.10.
|
4
|
+
version: 0.10.2
|
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-
|
11
|
+
date: 2017-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
195
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.6.
|
196
|
+
rubygems_version: 2.6.13
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: Track your GUI changes with diff assertions
|