1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Merge pull request #2135 from andrewhavens/feature/headless-firefox

Add Selenium Firefox Headless driver
This commit is contained in:
Thomas Walpole 2018-11-20 15:49:50 -08:00 committed by GitHub
commit 545ce2edbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -395,6 +395,7 @@ and add it to your Gemfile if you're using bundler.
Capybara pre-registers a number of named drives that use Selenium - they are:
* :selenium => Selenium driving Firefox
* :selenium_headless => Selenium driving Firefox in a headless configuration
* :selenium_chrome => Selenium driving Chrome
* :selenium_chrome_headless => Selenium driving Chrome in a headless configuration

View file

@ -532,6 +532,13 @@ Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app)
end
Capybara.register_driver :selenium_headless do |app|
Capybara::Selenium::Driver.load_selenium
browser_options = ::Selenium::WebDriver::Firefox::Options.new
browser_options.args << '-headless'
Capybara::Selenium::Driver.new(app, browser: :firefox, options: browser_options)
end
Capybara.register_driver :selenium_chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
end