puffing-billy 3.0.3 → 3.0.4

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: 6ba63b8d1332e409066b96b5e01205be8503dee2e3bb11ad8863df3c8c5586d2
4
- data.tar.gz: 8a8cee9e25a6c5cf5cdfc9fa5c3eb3a176827447ec41a0891351808cf1a67bca
3
+ metadata.gz: 16bed8180bba7ace31cc3516c9b30bddbce8531cfe5f4a1effd93572219f2952
4
+ data.tar.gz: d47667758e923263a1e98e2bb60c6ab1bf3962fa38722259addc4e59b4af129e
5
5
  SHA512:
6
- metadata.gz: 93c40d01325be4deb136bec1e3f0c5f375475669dd2b44a535733bbc54976eca5d7bcce58b2688ca916303a45dbb6f7bcf2df3bc20fdcdb7a18ab1c7e0bcda4f
7
- data.tar.gz: 4b66a6c0242bed4283dafdb5d7a68a9dc9357ab5ce75e87824afd0dd1b68fecf686863b242c95b8ddc239efb003423c9dd7687ff042228a16cbf1aad0b2e8fe2
6
+ metadata.gz: e7a47d5b299bb1b5ba9b6979317e383b498116cabfb6cf8bc924c75b0a2fd97684beafac596ee728b7c393b74f92229090b13fba5a06140846992c7234a50f4f
7
+ data.tar.gz: b7bb0f1fb51747f935c26fc3c4c455900c5a0971676ce4bba1ee8ddfe87740f7e5771ed529b22735687f15ad423da436dc8f7fd940e7179fb4d62e609641d669
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ v3.0.4, 2022-08-07
2
+ ------------------
3
+ * Adds a configurable Cuprite driver [#327](https://github.com/oesmith/puffing-billy/pull/327)
4
+
1
5
  v3.0.3, 2022-05-31
2
6
  -------------------
3
7
  * Only calculate cache scope and key if request is cacheable [#324](https://github.com/oesmith/puffing-billy/pull/324)
data/README.md CHANGED
@@ -65,6 +65,7 @@ Capybara.javascript_driver = :selenium_billy # Uses Firefox
65
65
  # Capybara.javascript_driver = :apparition_billy
66
66
  # Capybara.javascript_driver = :webkit_billy
67
67
  # Capybara.javascript_driver = :poltergeist_billy
68
+ # Capybara.javascript_driver = :cuprite_billy
68
69
  ```
69
70
 
70
71
  > __Note__: `:poltergeist_billy` doesn't support proxying any localhosts, so you must use
@@ -154,6 +155,20 @@ And /^a stub for google$/ do
154
155
  end
155
156
  ```
156
157
 
158
+ ### Setup remote Chrome
159
+
160
+ In the case you are using a Chrome instance, running on another machine, or in
161
+ another Docker container, you need to :
162
+ * Fix the Billy proxy host and port
163
+ * Passes the `--proxy-server=<billy host>:<billy port>`
164
+
165
+ #### WebSockets
166
+
167
+ Puffing billy doesn't support websockets, so if you are using them,
168
+ or ActionCable for the Ruby On Rails developers, you can tell Chrome to bypass
169
+ the proxy for websockets by adding the flag `--proxy-bypass-list=ws://*` to
170
+ your remote chrome intance or Docker container.
171
+
157
172
  ## Minitest Usage
158
173
 
159
174
  Please see [this link](https://gist.github.com/sauy7/1b081266dd453a1b737b) for
@@ -8,7 +8,8 @@ module Billy
8
8
  poltergeist: 'capybara/poltergeist',
9
9
  webkit: 'capybara/webkit',
10
10
  selenium: 'selenium/webdriver',
11
- apparition: 'capybara/apparition'
11
+ apparition: 'capybara/apparition',
12
+ cuprite: 'capybara/cuprite'
12
13
  }
13
14
 
14
15
  def self.register_drivers
@@ -108,6 +109,20 @@ module Billy
108
109
  end
109
110
  end
110
111
 
112
+ def self.register_cuprite_driver
113
+ driver_otions = {
114
+ browser_options: {
115
+ 'ignore-certificate-errors' => nil
116
+ }
117
+ }.deep_merge(Billy.config.cuprite_options)
118
+
119
+ ::Capybara.register_driver :cuprite_billy do |app|
120
+ ::Capybara::Cuprite::Driver.new(app, **driver_otions).tap do |driver|
121
+ driver.set_proxy(Billy.proxy.host, Billy.proxy.port)
122
+ end
123
+ end
124
+ end
125
+
111
126
  def self.build_selenium_options_for_firefox
112
127
  profile = Selenium::WebDriver::Firefox::Profile.new.tap do |prof|
113
128
  prof.proxy = Selenium::WebDriver::Proxy.new(
data/lib/billy/config.rb CHANGED
@@ -11,7 +11,8 @@ module Billy
11
11
  :non_whitelisted_requests_disabled, :cache_path, :certs_path, :verify_peer, :proxy_host, :proxy_port, :proxied_request_inactivity_timeout,
12
12
  :proxied_request_connect_timeout, :dynamic_jsonp, :dynamic_jsonp_keys, :dynamic_jsonp_callback_name, :merge_cached_responses_whitelist,
13
13
  :strip_query_params, :proxied_request_host, :proxied_request_port, :cache_request_body_methods, :after_cache_handles_request,
14
- :cache_simulates_network_delays, :cache_simulates_network_delay_time, :record_requests, :record_stub_requests, :use_ignore_params, :before_handle_request
14
+ :cache_simulates_network_delays, :cache_simulates_network_delay_time, :record_requests, :record_stub_requests, :use_ignore_params,
15
+ :before_handle_request, :cuprite_options
15
16
 
16
17
  def initialize
17
18
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -53,6 +54,7 @@ module Billy
53
54
  @record_stub_requests = false
54
55
  @use_ignore_params = true
55
56
  @before_handle_request = nil
57
+ @cuprite_options = {}
56
58
  end
57
59
  end
58
60
 
data/lib/billy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Billy
2
- VERSION = '3.0.3'
2
+ VERSION = '3.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puffing-billy
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olly Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec