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:
commit
545ce2edbc
2 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue