capybara-webmock 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/capybara/webmock.rb +12 -4
- data/lib/capybara/webmock/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bc6c2f9825d515f22f53917af7c84a501656ec3
|
4
|
+
data.tar.gz: e30c335727475840e4f5466d26d188ca1b8f2a13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40ec2c934eadcc69e3e9093909b2669ba3b9fa9e85408d2644af0b00ae8f794002fe833a306b42ef209c7aa61561c6b5a241da4ac4ee9428f6bd88b952b94179
|
7
|
+
data.tar.gz: 42716b2af6c19caee69ff215f16953073f1978aaf517c6332deb51a7e556f85bc68eae32618e8af74e0dafacd61bb1c7dc61c2a0702ac53569a61eae40616711
|
data/README.md
CHANGED
@@ -81,6 +81,8 @@ or:
|
|
81
81
|
```ruby
|
82
82
|
# Use Chrome Driver
|
83
83
|
Capybara.javascript_driver = :capybara_webmock_chrome
|
84
|
+
# or Chrome Driver in headless mode
|
85
|
+
Capybara.javascript_driver = :capybara_webmock_chrome_headless
|
84
86
|
```
|
85
87
|
|
86
88
|
```ruby
|
@@ -88,7 +90,7 @@ Capybara.javascript_driver = :capybara_webmock_chrome
|
|
88
90
|
Capybara.javascript_driver = :capybara_webmock_poltergeist
|
89
91
|
```
|
90
92
|
|
91
|
-
*NOTE: These are just
|
93
|
+
*NOTE: These are just some default driver wrappers this gem provides. If you are
|
92
94
|
already using a custom driver profile you can still use `capybara-webmock`, you
|
93
95
|
just need to configure proxy settings to `127.0.0.1:9292`*
|
94
96
|
|
data/lib/capybara/webmock.rb
CHANGED
@@ -68,7 +68,13 @@ module Capybara
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def chrome_options
|
71
|
-
|
71
|
+
::Selenium::WebDriver::Chrome::Options.new.tap do |options|
|
72
|
+
options.add_argument "--proxy-server=127.0.0.1:#{port_number}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def chrome_headless_options
|
77
|
+
chrome_options.tap { |options| options.headless! }
|
72
78
|
end
|
73
79
|
|
74
80
|
def phantomjs_options
|
@@ -162,9 +168,11 @@ Capybara.register_driver :capybara_webmock do |app|
|
|
162
168
|
end
|
163
169
|
|
164
170
|
Capybara.register_driver :capybara_webmock_chrome do |app|
|
165
|
-
Capybara::Selenium::Driver.new(app, browser: :chrome,
|
166
|
-
|
167
|
-
|
171
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: Capybara::Webmock.chrome_options)
|
172
|
+
end
|
173
|
+
|
174
|
+
Capybara.register_driver :capybara_webmock_chrome_headless do |app|
|
175
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: Capybara::Webmock.chrome_headless_options)
|
168
176
|
end
|
169
177
|
|
170
178
|
Capybara.register_driver :capybara_webmock_poltergeist do |app|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-webmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Worth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capybara
|