Skip to content

Commit

Permalink
test(): run tests on sauce labs
Browse files Browse the repository at this point in the history
  • Loading branch information
blackjid committed Mar 23, 2015
1 parent 1e96cfb commit b2827fd
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Expand Up @@ -2,8 +2,12 @@ language: node_js
sudo: false
node_js:
- 0.10

before_script:
- npm install -g karma-cli
- npm install -g bower
- bower install
addons:
sauce_connect: true
env:
global:
- secure: T6QHZz6rXedDMXgp7TdGRRL+fL4JtTgofRw1WJEtusKU0x4P2+y8dPPXSmxx63BaM0/l1Gl8SmffCXy+CaxKqcVqUq3qQFv5kZZVbtpW1cOce/Fw2vSfO4WLf6yra7FyIIxwe1nc+JvEEBHVTKXuGAs0kHb2dTKdrS3tOc/tP4Q=
- secure: WAANH0DdkRMjx/ZDw+xX4XAV12q869roNCaw7wcvVtTrDm95eya39QcgIXEzmIPQyecoyFto8yvjauw8uKQGQpnQ4b90tjx1oI06s8SW+IR6RQWRdQep1FM81GFaFd93sGEmhqoPyNUtRCUGRoFWDT93uE1P3zMZppIGeBmE4Q4=
122 changes: 122 additions & 0 deletions karma-sauce.conf.js
@@ -0,0 +1,122 @@
// Karma configuration
// Generated on Fri Aug 09 2013 14:14:35 GMT-0500 (CDT)

module.exports = function(config) {
config.set({

// Base path, that will be used to resolve files and exclude
basePath: '',

// Load jasmine and requirejs (require is used by the readme spec)
frameworks: ['jasmine'],

// List of files / patterns to load in the browser
files: [
// libraries
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',

// our app
'src/*.js',

// the specs
// Do not run the README test since it requires requirejs and I could make it work on sauce
'test/**/*spec.js'
],

// Karma plugins
plugins: [
'karma-jasmine',
'karma-sauce-launcher'
],

// List of files to exclude
exclude: [
'test/readme-spec.js'
],

// Test results reporter to use
// possible values: 'dots', 'progress', 'junit'
reporters: ['progress', 'saucelabs'],

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

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

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

// Broser connection tolerances (partially based on angularjs configuration)
captureTimeout: 0,
browserDisconnectTolerance: 2,
browserDisconnectTimeout: 10000,
browserNoActivityTimeout: 60000,

// Disable websocket for full browser tests
transports: ['xhr-polling'],

// Continuous Integration mode by default
singleRun: true,

// Sauce config, requires username and accessKey to be loaded in ENV
sauceLabs: {
testName: 'Angular Rut Tests',
startConnect: false
},

// Custom sauce launchers
customLaunchers:
{
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome',
version: '34'
},
'SL_Firefox': {
base: 'SauceLabs',
browserName: 'firefox',
version: '26'
},
'SL_Safari': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.9',
version: '7'
},
'SL_IE_8': { // TODO: fix IE8 tests, for some reason tests do not work as expected (but library does), maybe is a jasmine/angularjs issue?
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows XP',
version: '8'
},
'SL_IE_9': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2008',
version: '9'
},
'SL_IE_10': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2012',
version: '10'
},
'SL_IE_11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
}
},

browsers: ['SL_Chrome', 'SL_Firefox', 'SL_Safari', 'SL_IE_9', 'SL_IE_10', 'SL_IE_11']
});

// set tunnel identifier for travis builds, by default it uses the job number.
if (process.env.TRAVIS) {
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
}
};
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"name": "angular-rut",
"version": "0.3.0",
"engines": {
"node": ">= 0.9"
"node": ">=0.10"
},
"dependencies": {},
"devDependencies": {
Expand All @@ -15,9 +15,10 @@
"grunt-karma": "~0.9.0",
"grunt-git": "^0.2.14",
"karma-jasmine": "~0.3.2",
"karma-phantomjs-launcher": "~0.1.4"
"karma-phantomjs-launcher": "~0.1.4",
"karma-sauce-launcher": "^0.2.10"
},
"scripts": {
"test": "./node_modules/.bin/karma start --single-run --no-auto-watch --browsers PhantomJS"
"test": "./node_modules/.bin/karma start karma-sauce.conf.js --single-run"
}
}

0 comments on commit b2827fd

Please sign in to comment.