capybara-rack_test-screenshot 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 6039bb83ad6f645896e9d1ee68894c2e7ebbee5403a49239b21968115e0231f1
4
- data.tar.gz: f4189a2f768e6dcd6067042edc04978e854d349f030b0430eab80a62f4309b90
3
+ metadata.gz: 8165f761bf47281da1979d31ff8c358d54431bae76b7836076ba243fc3379ed5
4
+ data.tar.gz: 4e0527e42e2e8f73ca2f510d62eeb2e0550f79b81214b62e7e99e59c3e3aa87e
5
5
  SHA512:
6
- metadata.gz: 9852f3e869492a90c8eb6711d91c280b3ee8362e3a9b2a30be1f84031d4458ef75992766da1650fc34405faedb2765dcd36c9583b29a45f902679428dff6d716
7
- data.tar.gz: 1f1b23aa92132b47e40aa7badbd811b289c361a8dcc3abc6c0a61b3b1a0514b4cd430476a5fc39b203e3c5a41dd5e500acb74f161fbf97b356dca9fa6b6b462f
6
+ metadata.gz: 95fb74ed5744e8902cf216c1b26e004e18aca69efc5e9e6269b5830820e78ac29e14524904efcc045d31380f93d2bb793021b894aba0d3b7d7593113862db340
7
+ data.tar.gz: dd6bc0da76d16db6b244fff65b597661185647d13ceadc37bcf200705502052d06c66cc4bf3acf99147385097d5679c831aa818538d3496bd745653fa35e302c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2025-06-10
4
+
5
+ - Add compatibility with `capybara-screenshot` gem
6
+
3
7
  ## [0.1.0] - 2024-03-14
4
8
 
5
9
  - Initial release
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/capybara-rack_test-screenshot.svg)](https://rubygems.org/gems/capybara-rack_test-screenshot)
2
+
1
3
  # Generate screenshots with RackTest
2
4
 
3
5
  Makes `save_screenshot` behave as if you were using a regular browser when using `rack` as your Capybara driver.
@@ -16,16 +18,11 @@ RSpec.configure do |config|
16
18
  puts "Screenshot at #{path}"
17
19
  end
18
20
  end
19
-
20
- # Or for Rails projects
21
- config.after(:each) do |example|
22
- if example.exception
23
- take_screenshot(screenshot: 'inline')
24
- end
25
- end
26
21
  end
27
22
  ```
28
23
 
24
+ Also makes failing Rails System tests behave the same between `rack` and JS drivers.
25
+
29
26
  ## Installation
30
27
 
31
28
  Install the gem and add to the application's Gemfile by executing:
@@ -41,7 +38,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
41
38
  You'll need to configure `Capybara.asset_host` in order for Playwright to render the page properly. This should point to a running development server of your application.
42
39
 
43
40
  ```rb
44
- Capybara.asset_host = "http://localhost:3000
41
+ Capybara.asset_host = "http://localhost:3000"
45
42
  ```
46
43
 
47
44
  Optional settings:
@@ -93,6 +90,10 @@ RSpec.configure do |config|
93
90
  end
94
91
  ```
95
92
 
93
+ ## capybara-screenshot
94
+
95
+ This gem is compatible with `capybara-screenshot`. You'll need to list `capybara-screenshot` before this gem in your Gemfile.
96
+
96
97
  ## Development
97
98
 
98
99
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -3,7 +3,7 @@
3
3
  module Capybara
4
4
  module RackTest
5
5
  module Screenshot
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.1"
7
7
  end
8
8
  end
9
9
  end
@@ -105,3 +105,9 @@ end
105
105
  if defined?(Rails)
106
106
  require_relative 'screenshot/railtie'
107
107
  end
108
+
109
+ if defined?(Capybara::Screenshot)
110
+ Capybara::Screenshot.register_driver(:rack_test) do |driver, path|
111
+ driver.save_screenshot(path)
112
+ end
113
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-rack_test-screenshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theodor Tonum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-14 00:00:00.000000000 Z
11
+ date: 2025-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara