mirror of
https://github.com/hanzoai/hanzo-analytics.git
synced 2026-09-30 22:38:56 +00:00
30 lines
804 B
CoffeeScript
30 lines
804 B
CoffeeScript
webdriver = require 'webdriverio'
|
|
|
|
exports.getBrowser = ->
|
|
browserName = process.env.BROWSER
|
|
|
|
opts =
|
|
desiredCapabilities:
|
|
browserName: browserName ? 'phantomjs'
|
|
'phantomjs.binary.path': './node_modules/phantomjs/bin/phantomjs'
|
|
logLevel: 'verbose'
|
|
|
|
if process.env.TRAVIS?
|
|
opts =
|
|
desiredCapabilities:
|
|
browserName: browserName
|
|
name: process.env.TRAVIS_COMMIT
|
|
tags: [
|
|
process.env.TRAVIS_PULL_REQUEST
|
|
process.env.TRAVIS_BRANCH
|
|
process.env.TRAVIS_BUILD_NUMBER
|
|
]
|
|
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER
|
|
host: 'ondemand.saucelabs.com'
|
|
port: 80
|
|
user: process.env.SAUCE_USERNAME
|
|
key: process.env.SAUCE_ACCESS_KEY
|
|
logLevel: 'silent'
|
|
|
|
webdriver.remote(opts).init()
|