Selenium::DriverのChrome のオプションの渡し方が変わってた

https://github.com/SeleniumHQ/selenium/compare/selenium-3.12.0...selenium-3.13.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 890a93ba..3cde2021 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -29,13 +29,13 @@ RSpec.configure do |config|
Capybara.configure do |config|
config.server = :puma
end
+
Capybara.register_driver :headless_chrome do |app|
Capybara::Selenium::Driver.new(app,
browser: :chrome,
- desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome(
- chrome_options: {
- args: %w(--headless --disable-gpu window-size=1680,1050 --lang=ja-JP --proxy-server=127.0.0.1:9292),
- },
+ desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome(),
+ options: Selenium::WebDriver::Chrome::Options.new(
+ args: %w(--headless --disable-gpu window-size=1680,1050 --lang=ja-JP --proxy-server=127.0.0.1:9292)
)
)
end