Merge pull request #4229 from betagouv/fix_capybara_on_sims_desktop

Fix capybara on linux ubuntu
This commit is contained in:
Paul Chavard 2019-08-22 11:13:36 +02:00 committed by GitHub
commit 5cc3a9eb60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,13 +39,18 @@ Capybara.register_driver :chrome do |app|
end
Capybara.register_driver :headless_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--window-size=1440,900')
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: ['headless', 'disable-dev-shm-usage', 'disable-software-rasterizer', 'mute-audio', 'window-size=1440,900'] }
)
Capybara::Selenium::Driver.new app,
browser: :chrome,
desired_capabilities: capabilities
desired_capabilities: capabilities,
options: options
end
# FIXME: remove this line when https://github.com/rspec/rspec-rails/issues/1897 has been fixed