Skip to content

Commit

Permalink
feat(test): add sauce labs support
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Oct 24, 2016
1 parent 8fda48f commit bec951f
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 5 deletions.
72 changes: 68 additions & 4 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,73 @@ const path = require('path')
const webpackConfig = require('./webpack')
const timeout = require('./custom').timeout

const browsers = []
let concurrency = 1
let reporters = ['mocha-own']

const launchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'Chrome',
platform: 'Windows 10',
version: '53'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'Firefox',
platform: 'Windows 10',
version: '48'
}
// These are not fully supported currently
// ,
// sl_safari: {
// base: 'SauceLabs',
// browserName: 'Safari',
// platform: 'OS X 10.11',
// version: 'latest'
// },
// sl_ie_11: {
// base: 'SauceLabs',
// browserName: 'Internet Explorer',
// platform: 'Windows 10',
// version: '11'
// },
// sl_edge: {
// base: 'SauceLabs',
// browserName: 'MicrosoftEdge',
// platform: 'Windows 10',
// version: '14.14393'
// },
// sl_android: {
// base: 'SauceLabs',
// browserName: 'Browser',
// deviceName: 'Android Emulator',
// platformName: 'Android',
// appiumVersion: '1.5.3',
// platformVersion: '5.1',
// deviceOrientation: 'portrait'
// },
// sl_iphone: {
// base: 'SauceLabs',
// browserName: 'Safari',
// deviceName: 'iPhone Simulator',
// platformName: 'iOS',
// platformVersion: '9.3',
// appiumVersion: '1.5.3',
// deviceOrientation: 'portrait'
// }
}

let browsers = []


if (process.env.TRAVIS) {
browsers.push('Firefox')
if (process.env.SAUCE_USERNAME) {
browsers = Object.keys(launchers)
concurrency = 2
reporters = ['progress', 'saucelabs']
} else {
browsers.push('Firefox')
}
} else {
browsers.push('Chrome')
}
Expand All @@ -34,7 +97,7 @@ module.exports = function (config) {
webpackMiddleware: {
noInfo: true
},
reporters: ['mocha-own'],
reporters: reporters,
mochaOwnReporter: {
reporter: 'spec'
},
Expand All @@ -43,8 +106,9 @@ module.exports = function (config) {
logLevel: process.env.DEBUG ? config.LOG_DEBUG : config.LOG_INFO,
autoWatch: false,
browsers: browsers,
customLaunchers: launchers,
singleRun: false,
concurrency: 1,
concurrency: concurrency,
browserNoActivityTimeout: timeout,
failOnEmptyTestSuite: false
})
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"karma-mocha": "^1.1.1",
"karma-mocha-own-reporter": "^1.1.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sauce-launcher": "^1.1.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"lodash.camelcase": "^4.3.0",
Expand Down Expand Up @@ -92,4 +93,4 @@
"Stephen Whitmore <stephen.whitmore@gmail.com>",
"npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>"
]
}
}

0 comments on commit bec951f

Please sign in to comment.