Drivers
Provides Capybara driver definitions for using Chrome with self-signed HTTPS via localhost only.
Usage
In your Capybara configuration, you'd typically select one of the named server configurations:
Capybara.configure do |config|
config.javascript_driver = :selenium_chrome_https
# Or for headless:
config.javascript_driver = :selenium_chrome_headless_https
end
Definitions
selenium_chrome_https { ... }
A selenium driver for chrome which allows insecure localhost https protocol.
Signature
-
attribute
Block
Implementation
Capybara.register_driver :selenium_chrome_https do |app|
chrome_options = Selenium::WebDriver::Chrome::Options.new
chrome_options.add_argument('--allow-insecure-localhost')
chrome_options.add_argument('--ignore-certificate-errors')
Capybara::Selenium::Driver.new(app,
browser: :chrome,
options: chrome_options)
end
selenium_chrome_headless_https { ... }
A headless selenium driver for chrome which allows insecure localhost https protocol.
Signature
-
attribute
Block
Implementation
Capybara.register_driver :selenium_chrome_headless_https do |app|
chrome_options = Selenium::WebDriver::Chrome::Options.new
chrome_options.add_argument('--allow-insecure-localhost')
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument('--headless=true')
Capybara::Selenium::Driver.new(app,
browser: :chrome,
options: chrome_options)
end