Skip to content

Instantly share code, notes, and snippets.

@davidcornu
Created January 23, 2013 16:32
Show Gist options
  • Save davidcornu/4609267 to your computer and use it in GitHub Desktop.
Save davidcornu/4609267 to your computer and use it in GitHub Desktop.
webdriver = require("wd")
browser = null
desired =
browserName: 'chrome'
platform: 'Windows 2008'
exports.init = (callback) ->
return callback(null, browser) if browser
console.log "initializing browser... "
driver = webdriver.remote "ondemand.saucelabs.com", 80,
process.env.BUSPLATFORM_SAUCELABS_USERNAME,
process.env.BUSPLATFORM_SAUCELABS_SECRET_KEY
driver.init desired, (err) ->
return callback(err) if err
browser = driver
callback(null, browser)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment