Skip to content

Instantly share code, notes, and snippets.

@cheesepaulo
Created June 22, 2018 22:19
Show Gist options
  • Save cheesepaulo/d7e967f7434553043511a6a8637eced9 to your computer and use it in GitHub Desktop.
Save cheesepaulo/d7e967f7434553043511a6a8637eced9 to your computer and use it in GitHub Desktop.
# Capybara config with docker-compose environment vars
Capybara.app_host = "http://#{ENV['TEST_APP_HOST']}:#{ENV['TEST_PORT']}"
Capybara.default_driver = :selenium
Capybara.javascript_driver = :selenium
Capybara.run_server = false
# Configure the Chrome driver capabilities & register
args = ['--no-default-browser-check', '--start-maximized']
caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => args})
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(
app,
browser: :remote,
url: "http://#{ENV['SELENIUM_HOST']}:#{ENV['SELENIUM_PORT']}/wd/hub",
desired_capabilities: caps
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment