closer 0.18.4 → 0.18.5
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/HISTORY.md +4 -0
- data/lib/closer/helpers/capybara.rb +2 -0
- data/lib/closer/helpers/capybara_patch.rb +39 -0
- data/lib/closer/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9eaa72de2f0d092dfb273ee5b8c0e3d1295aac9db21ef530da276f4dc189d8af
|
|
4
|
+
data.tar.gz: f6bea894248905b7b49469b6d616b4ae3b84e0bc17d9703a82d87eef0bc7b896
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03ed3f53567eea31a7a0803061a66b11b7c6f119dceff28d96056b76f2b160f3b939cc02fe9672c466854b98700c0c9945ecb0eebf85e2e6b3ce6b3798b0bbec
|
|
7
|
+
data.tar.gz: e16ffeaa1bc2ca3af6f04e49bfd621513c4c5fb82f05ced18ff761ca7cd903875dc88b188b86da6ced9c7143f3e1a592066e738e484e963302500001b1178aca
|
data/HISTORY.md
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# https://github.com/ifmeorg/ifme/pull/2548
|
|
2
|
+
#
|
|
3
|
+
# Capybara 3.39.2 resets the Chrome browser state between examples with
|
|
4
|
+
# Storage.clearDataForOrigin and `origin: '*'`. Recent Chrome releases
|
|
5
|
+
# (158+) reject that wildcard with "invalid argument: * is not a valid URL",
|
|
6
|
+
# which fails every browser (feature) spec.
|
|
7
|
+
#
|
|
8
|
+
# Clear the same data without the wildcard: all cookies through
|
|
9
|
+
# Storage.clearCookies, and any other storage (e.g. local storage) for the
|
|
10
|
+
# origin of the Capybara app server, which is the only origin the specs use.
|
|
11
|
+
#
|
|
12
|
+
# Remove this once Capybara ships a release that no longer sends the wildcard.
|
|
13
|
+
unless Gem::Requirement.new('> 3.40.0').satisfied_by?(Gem::Version.new(Capybara::VERSION))
|
|
14
|
+
require 'capybara/selenium/driver'
|
|
15
|
+
|
|
16
|
+
module ChromePatch
|
|
17
|
+
WILDCARD_ORIGIN = '*'
|
|
18
|
+
|
|
19
|
+
def execute_cdp(cmd, params = {})
|
|
20
|
+
return super unless cmd == 'Storage.clearDataForOrigin' &&
|
|
21
|
+
params[:origin] == WILDCARD_ORIGIN
|
|
22
|
+
|
|
23
|
+
storage_types = params[:storageTypes].to_s.split(',')
|
|
24
|
+
super('Storage.clearCookies', {}) if storage_types.delete('cookies')
|
|
25
|
+
clear_storage_for_app_server(cmd, params, storage_types)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def clear_storage_for_app_server(cmd, params, storage_types)
|
|
31
|
+
origin = Capybara.current_session.server&.base_url
|
|
32
|
+
return if origin.nil? || storage_types.empty?
|
|
33
|
+
|
|
34
|
+
execute_cdp(cmd, params.merge(origin:, storageTypes: storage_types.join(',')))
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
Capybara::Selenium::Driver::ChromeDriver.prepend(ChromePatch)
|
|
39
|
+
end
|
data/lib/closer/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: closer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.18.
|
|
4
|
+
version: 0.18.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ichy
|
|
@@ -129,6 +129,7 @@ files:
|
|
|
129
129
|
- lib/closer/helpers.rb
|
|
130
130
|
- lib/closer/helpers/capture.rb
|
|
131
131
|
- lib/closer/helpers/capybara.rb
|
|
132
|
+
- lib/closer/helpers/capybara_patch.rb
|
|
132
133
|
- lib/closer/helpers/driver.rb
|
|
133
134
|
- lib/closer/helpers/drivers/chrome.rb
|
|
134
135
|
- lib/closer/helpers/drivers/file_detector.rb
|