Bump selenium-webdriver from 4.0.0 to 4.11.0
Webdrivers doesn't seem to be working with GitHub Actions since Chrome changed the way to download ChromeDriver [1]. Luckily, webdrivers functionality has recently been added directly to selenium-webdriver, and version 4.11.0 is compatible with the new way to download ChromeDriver. So we're updating selenium-webdriver and removing webdrivers. Note we now have to use the `Options` class instead of the `Capabilities`. We're updating Capybara since its changelog mentions its latest version also adapts these changes in Selenium. [1] https://groups.google.com/g/chromedriver-users/c/qVPTFXnedw0
This commit is contained in:
@@ -54,17 +54,14 @@ end
|
||||
FactoryBot.use_parent_strategy = false
|
||||
|
||||
Capybara.register_driver :headless_chrome do |app|
|
||||
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
||||
"goog:chromeOptions" => {
|
||||
args: %W[headless no-sandbox window-size=1200,800 proxy-server=#{Capybara.app_host}:#{Capybara::Webmock.port_number}]
|
||||
}
|
||||
)
|
||||
options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
|
||||
opts.add_argument "--headless"
|
||||
opts.add_argument "--no-sandbox"
|
||||
opts.add_argument "--window-size=1200,800"
|
||||
opts.add_argument "--proxy-server=#{Capybara.app_host}:#{Capybara::Webmock.port_number}"
|
||||
end
|
||||
|
||||
Capybara::Selenium::Driver.new(
|
||||
app,
|
||||
browser: :chrome,
|
||||
capabilities: capabilities
|
||||
)
|
||||
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
||||
end
|
||||
|
||||
Capybara.exact = true
|
||||
|
||||
Reference in New Issue
Block a user