Skip to content

Commit

Permalink
integrate with saucelabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-xiao-jian committed Mar 4, 2015
1 parent 3718ec2 commit 589bf41
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
language: node_js
node_js:
- "0.12"
env:
global:
- secure: ZRsiHLQKzQT/+AZ/hF2UVjoKe7T8nF59CpT8glo2MPfJ0dKkblDULAxwYJv4VWHP+yH+7OH07EZxP0xGm0fJVA9lxQkfIfl0//YHqqgOpCU4dyiueW9mr3SV8bASm2pJGP74/QKpyRDuznT35LEVabgaKyZcfFmw7hQr0NuDDQc=
- secure: fHsOrRgOmvJHRm8Ha4101IGjrf6vxrABrf+xKZEYQxQFuxhVc/e4EIltp89mUdIw3+/M8OvGZUYwB3adXCYObf2Y2rID/AYwF2wOKNSs5/BAiVhg1MDgCrTRyTfVdt3zOyHp+B3F7fh94F1DvBlgLzZUEv00SurHw9WrzH9nMjc=
before_install:
- "npm run-script prepare-test"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script: "npm run-script test-travis"
after_script: "npm run-script test-saucelab"
after_success: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
"karma-coverage": "~0.2.7",
"karma-firefox-launcher": "^0.1.4",
"karma-ie-launcher": "^0.1.5",
"karma-jasmine": "^0.3.5"
"karma-jasmine": "^0.3.5",
"karma-sauce-launcher": "^0.2.10"
},
"scripts": {
"test": "./node_modules/.bin/karma start karma.conf.js",
"test-travis": "./node_modules/.bin/karma start CI.conf.js",
"test-saucelab": "./node_modules/.bin/karma start saucelab.conf.js",
"prepare-test": "npm install bower && ./node_modules/.bin/bower -F install"
},
"author": "bornkiller",
Expand Down
91 changes: 91 additions & 0 deletions saucelab.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
module.exports = function(config) {
var customLaunchers = {
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome',
version: '40',
platform: 'Windows 8.1'
},
'SL_Firefox': {
base: 'SauceLabs',
browserName: 'firefox',
version: '35',
platform: 'Windows 8.1'
},
'SL_IE_11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
},
'SL_IE_10': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8',
version: '10'
}
};
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'bower_components/jquery/dist/jquery.js',
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'src/storage.js',
'test/*.spec.js'
],


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
// plugin support: junit, should config junitReporter in use
// plugin support: coverage, should config coverageReporter and preprocessors in use
reporters: ['saucelabs'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,


sauceLabs: {
testName: 'angularLocalStorage'
},


customLaunchers: customLaunchers,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// available options 'Chrome', 'IE', 'Firefox', 'PhantomJS' while 'IE8','IE9' approaching
browsers: Object.keys(customLaunchers),


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
});
};

0 comments on commit 589bf41

Please sign in to comment.