capybara-screenshot 1.0.24 → 1.0.25

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: 9173336311afd7772ceaebd05d500cad3925180fdd26bfa0d1a94b288b2e986a
4
- data.tar.gz: abe6e6b10ccbee3a4d282e123b356d58afc9159845acfcb81085f844f3693cc6
3
+ metadata.gz: 8539dcf08bbfb122dfb190cd76f82361373b4016888d02e65daedf42998e7cd2
4
+ data.tar.gz: bb64e6eb25278f8564a694784b21f9f38d3c550cf6cd2949fe5b5dd2adf5b916
5
5
  SHA512:
6
- metadata.gz: 5b58329ad3a72fa994669bf91ee70c98fc4b68c982adbc1ae06de3185dbd3b6d0e0ad2eb58f2cc4080be06df9e00bb7326b5b093aba547fd4353d1017f8c60aa
7
- data.tar.gz: f60be53d30e879359e389817bae5967113b82e33ead30626b2d0bb8bc8d5ba8ace2294df5923e5aaec5b1ba50ae0281e6fac01f2a437ffb97caf76b48c6d2c3d
6
+ metadata.gz: c1b62365f1e18a17bc4e0d0443bce7194dd7fe9fdbe846df3ea68b45583d452e6fe0047611f8639eb43bc015307de9f993a1485164ddf502879801fd213f9031
7
+ data.tar.gz: 5a599e20a7684bf4045c2cb318099af8a9385705e83afe342fe756bd592dfc762816dcd54a3946a370b84805dc3d65c8ce2e5fb927c3673256e4c362131611aa
@@ -1,3 +1,9 @@
1
+ 4 Oct 2020 - 1.0.24 -> 1.0.25
2
+
3
+ * [Fix Cucumber 5 deprecation warnings](https://github.com/mattheworiordan/capybara-screenshot/pull/274)
4
+ * [Add support for Cuprite driver](https://github.com/mattheworiordan/capybara-screenshot/pull/270)
5
+ * [Rails system spec compatibility](https://github.com/mattheworiordan/capybara-screenshot/pull/264)
6
+
1
7
  24 Nov 2019 - 1.0.23 -> 1.0.24
2
8
 
3
9
  * [Support Apparition driver](https://github.com/mattheworiordan/capybara-screenshot/commit/273317b241d1d1d8600b32fad998742894424f3b)
data/Gemfile CHANGED
@@ -4,6 +4,6 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  gem 'rack', '~> 1.0'
7
- gem 'rake', '~> 10.0'
7
+ gem 'rake', '~> 13.0'
8
8
  gem 'appraisal', '~> 2.0'
9
9
  gem 'aruba', '~> 0.14.0'
data/README.md CHANGED
@@ -8,7 +8,7 @@ capybara-screenshot gem
8
8
  #### Capture a screenshot for every test failure automatically!
9
9
 
10
10
  `capybara-screenshot` used with [Capybara](https://github.com/jnicklas/capybara) alongside [Cucumber](http://cukes.info/), [Rspec](https://www.relishapp.com/rspec) or [Minitest](https://github.com/seattlerb/minitest), will capture a screenshot for each failure in your test suite. Associated screenshot and HTML file
11
- of the failed page (when using [capybara-webkit](https://github.com/thoughtbot/capybara-webkit), [Selenium](http://seleniumhq.org/) or [poltergeist](https://github.com/jonleighton/poltergeist)) is saved into `$APPLICATION_ROOT/tmp/capybara`.
11
+ of the failed page (when using [capybara-webkit](https://github.com/thoughtbot/capybara-webkit), [Selenium](http://seleniumhq.org/), [poltergeist](https://github.com/jonleighton/poltergeist) or [cuprite](https://github.com/machinio/cuprite)) is saved into `$APPLICATION_ROOT/tmp/capybara`.
12
12
 
13
13
  Available screenshots for each test failure is incredibly helpful for diagnosing problems quickly in your failing steps. You have the ability to view screenshots (when applicable) and source code at the time of each failure.
14
14
 
@@ -130,7 +130,7 @@ This will cause Capybara to add `<base>http://localhost:3000</base>` to the HTML
130
130
  rails s -p 3000
131
131
  ```
132
132
 
133
- Now when you open the page, you should have something that looks much better. You can leave this setup in place and use the default HTML pages when you don't care about the presentation, or start the rails server when you need something better looking.
133
+ Now when you open the page, you should have something that looks much better. You can leave this setup in place and use the default HTML pages when you don't care about the presentation, or start the rails server when you need something better looking.
134
134
 
135
135
  Driver configuration
136
136
  --------------------
@@ -330,11 +330,12 @@ About
330
330
 
331
331
  This gem was written by **Matthew O'Riordan**, with contributions from [many kind people](https://github.com/mattheworiordan/capybara-screenshot/network/members).
332
332
 
333
- - [http://mattheworiordan.com](http://mattheworiordan.com)
333
+ - [http://mattheworiordan.com](http://mattheworiordan.com), [Technical co-founder & CEO of Ably Realtime](https://ably.com/)
334
334
  - [@mattheworiordan](http://twitter.com/#!/mattheworiordan)
335
- - [Linked In](http://www.linkedin.com/in/lemon)
335
+ - [Linked In](http://www.linkedin.com/in/mattoriordan)
336
+
336
337
 
337
338
  License
338
339
  -------
339
340
 
340
- Copyright © 2016 Matthew O'Riordan, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.
341
+ Copyright © 2020 Matthew O'Riordan, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.
@@ -12,8 +12,12 @@ Gem::Specification.new do |s|
12
12
  s.summary = %q{Automatically create snapshots when Cucumber steps fail with Capybara and Rails}
13
13
  s.description = %q{When a Cucumber step fails, it is useful to create a screenshot image and HTML file of the current page}
14
14
  s.license = 'MIT'
15
-
16
- s.rubyforge_project = "capybara-screenshot"
15
+ s.metadata = {
16
+ "bug_tracker_uri" => "https://github.com/mattheworiordan/capybara-screenshot/issues",
17
+ "changelog_uri" => "https://github.com/mattheworiordan/capybara-screenshot/blob/master/CHANGELOG.md",
18
+ "documentation_uri" => "https://www.rubydoc.info/gems/capybara-screenshot/#{s.version}",
19
+ "source_code_uri" => "https://github.com/mattheworiordan/capybara-screenshot/tree/v#{s.version}",
20
+ }
17
21
 
18
22
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("1.9")
19
23
  s.add_dependency 'capybara', ['>= 1.0', '< 2']
@@ -190,10 +190,14 @@ Capybara::Screenshot.class_eval do
190
190
  :not_supported
191
191
  end
192
192
  end
193
-
193
+
194
194
  register_driver(:apparition) do |driver, path|
195
195
  driver.save_screenshot(path)
196
196
  end
197
+
198
+ register_driver(:cuprite) do |driver, path|
199
+ driver.render(path, :full => true)
200
+ end
197
201
  end
198
202
 
199
203
  # Register filename prefix formatters
@@ -21,7 +21,13 @@ After do |scenario|
21
21
  saver.display_image
22
22
  #this will embed the image in the HTML report, embed() is defined in cucumber
23
23
  encoded_img = Base64.encode64(image)
24
- embed(encoded_img, 'image/png;base64', "Screenshot of the error")
24
+
25
+ # cucumber5 deprecates embed in favor of attach
26
+ if respond_to? :attach
27
+ attach(encoded_img, 'image/png')
28
+ else
29
+ embed(encoded_img, 'image/png;base64', "Screenshot of the error")
30
+ end
25
31
  end
26
32
  end
27
33
  end
@@ -90,6 +90,14 @@ RSpec.configure do |config|
90
90
  Capybara::Screenshot.final_session_name = nil
91
91
  end
92
92
 
93
+ # TODO: DRY refactor into a method?
94
+ # Add support for Rails system specs (previously only worked with feature specs)
95
+ config.after(type: :system) do |example_from_block_arg|
96
+ # RSpec 3 no longer defines `example`, but passes the example as block argument instead
97
+ example = config.respond_to?(:expose_current_running_example_as) ? example_from_block_arg : self.example
98
+
99
+ Capybara::Screenshot::RSpec.after_failed_example(example)
100
+ end
93
101
  config.after(type: :feature) do |example_from_block_arg|
94
102
  # RSpec 3 no longer defines `example`, but passes the example as block argument instead
95
103
  example = config.respond_to?(:expose_current_running_example_as) ? example_from_block_arg : self.example
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Screenshot
3
- VERSION = '1.0.24'
3
+ VERSION = '1.0.25'
4
4
  end
5
5
  end
@@ -298,6 +298,19 @@ describe Capybara::Screenshot::Saver do
298
298
  end
299
299
  end
300
300
 
301
+ describe "with cuprite driver" do
302
+ before do
303
+ allow(capybara_mock).to receive(:current_driver).and_return(:cuprite)
304
+ end
305
+
306
+ it 'saves driver render with :full => true' do
307
+ expect(driver_mock).to receive(:render).with(screenshot_path, {:full => true})
308
+
309
+ saver.save
310
+ expect(saver).to be_screenshot_saved
311
+ end
312
+ end
313
+
301
314
  describe "with webkit driver" do
302
315
  before do
303
316
  allow(capybara_mock).to receive(:current_driver).and_return(:webkit)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-screenshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.24
4
+ version: 1.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew O'Riordan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-24 00:00:00.000000000 Z
11
+ date: 2020-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -240,7 +240,11 @@ files:
240
240
  homepage: http://github.com/mattheworiordan/capybara-screenshot
241
241
  licenses:
242
242
  - MIT
243
- metadata: {}
243
+ metadata:
244
+ bug_tracker_uri: https://github.com/mattheworiordan/capybara-screenshot/issues
245
+ changelog_uri: https://github.com/mattheworiordan/capybara-screenshot/blob/master/CHANGELOG.md
246
+ documentation_uri: https://www.rubydoc.info/gems/capybara-screenshot/1.0.25
247
+ source_code_uri: https://github.com/mattheworiordan/capybara-screenshot/tree/v1.0.25
244
248
  post_install_message:
245
249
  rdoc_options: []
246
250
  require_paths: