Skip to content

Instantly share code, notes, and snippets.

@DylanLacey
Last active December 14, 2015 00:59
Show Gist options
  • Save DylanLacey/5002480 to your computer and use it in GitHub Desktop.
Save DylanLacey/5002480 to your computer and use it in GitHub Desktop.
How to use Sauce Labs with Capybara only for remote tests (with :js => true)
# Include this in spec_helper when you're running remotely
Capybara.register_driver :selenium do |app|
require 'selenium-webdriver'
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
Capybara::Selenium::Driver.new(app, {
:url => "https://sauce_username:[email protected]:80/wd/hub",
:browser => :remote,
:desired_capabilities => capabilities
})
@dali-ifg
Copy link

Dylan, I don't feel comfortable putting my credentials in the URL over HTTP. Is the same endpoint available over HTTPS and is there any other auth method that I could use?

@DylanLacey
Copy link
Author

Yes, you can absolutely use https, it was just a typo (and sorry for the reply delay, I didn't get a comment notification for some reason >.>)

You can pass the parameters are part of the desired capabilities, simply include username and access_key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment