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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee5312f8b47f5b041ab6adb1548194bdcef81744
4
- data.tar.gz: 597e1b2888f73579189875cbd4561df9e25cad74
3
+ metadata.gz: 85d1673c71c3656cae04ccb2ef3064af14f8f399
4
+ data.tar.gz: ade0e18548afcf5d1701f329c724722d4d4359f1
5
5
  SHA512:
6
- metadata.gz: a0f3fdaa1e9f460e213a50718d5074a027a6e3015ae551b9ad459db2a3be856e085d35c8efdb9c2f82cf2d4af900e9b7881b299e363f24d0cc352f524e26a9d8
7
- data.tar.gz: 9a96bf9314d7a6efe436c17752e5bafcfdda71b8ea455ac1ba7b2c2395a3c724804c9072fb3fdb970e6a6155fa2fd817386ff2a6b6cb4d638e4a2b0ed9019a17
6
+ metadata.gz: 9693765e3bf37e1bf7d1a10649ea20e9ae604fdf188a33c87f918341459b27740062fd6075b9ce0438c142ec2723c5f50077e9282ae911608f5c75c9b4b8dce1
7
+ data.tar.gz: 06c41cd6bec74485d4448b84d877e0f1e90ff227888b2adf09210cbc1a9d757a34a2da3c479d7c26f07d3b701643b0db349a72aa6bc9ff7a9ce771f19c368192
data/.rubocop_todo.yml CHANGED
@@ -13,7 +13,7 @@ Metrics/AbcSize:
13
13
  # Offense count: 1
14
14
  # Configuration parameters: CountComments.
15
15
  Metrics/ClassLength:
16
- Max: 182
16
+ Max: 186
17
17
 
18
18
  # Offense count: 3
19
19
  Metrics/CyclomaticComplexity:
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.default_driver.to_s if Capybara::Screenshot.add_driver_path
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
 
@@ -3,7 +3,7 @@
3
3
  module Capybara
4
4
  module Screenshot
5
5
  module Diff
6
- VERSION = '0.10.1'.freeze
6
+ VERSION = '0.10.2'.freeze
7
7
  end
8
8
  end
9
9
  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.10.1
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-09-22 00:00:00.000000000 Z
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.11
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