Skip to content

Instantly share code, notes, and snippets.

@raditotev
Last active November 28, 2017 18:27
Show Gist options
  • Save raditotev/ab8e5d78ecc6656a4bc8178f9ecc233a to your computer and use it in GitHub Desktop.
Save raditotev/ab8e5d78ecc6656a4bc8178f9ecc233a to your computer and use it in GitHub Desktop.
Cucumber configuration for SeleniumGrid
if ENV['REMOTE'].eql?("true")
hub_url = 'http://localhost:4444/wd/hub'
capabilities = Selenium::WebDriver::Remote::Capabilities.send(ENV['DRIVER'])
capabilities['version'] = ENV['VERSION']
capabilities['takesScreenshot'] = true
capabilities['javascriptEnabled'] = true
Capybara.register_driver :remote_browser do |app|
Capybara::Selenium::Driver.new(
app,
browser: :remote,
url: hub_url,
desired_capabilities: capabilities
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment