-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf-ci.js
88 lines (80 loc) · 2.22 KB
/
karma.conf-ci.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var fs = require('fs');
var baseConf = require('./karma.conf-base')
var _ = require('lodash')
module.exports = function(config) {
// Use ENV vars on Travis and sauce.json locally to get credentials
if (!process.env.SAUCE_USERNAME) {
if (!fs.existsSync('sauce.json')) {
console.log('Create a sauce.json with your credentials based on the sauce-sample.json file.');
process.exit(1);
} else {
process.env.SAUCE_USERNAME = require('./sauce.json').SAUCE_USERNAME;
process.env.SAUCE_ACCESS_KEY = require('./sauce.json').SAUCE_ACCESS_KEY;
}
}
// Browsers to run on Sauce Labs
var customLaunchers = {
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome',
version: '45'
},
'SL_Firefox': {
base: 'SauceLabs',
browserName: 'firefox',
version: '39'
},
'SL_Safari': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.10',
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'
},
'SL_iOS': {
base: "SauceLabs",
browserName: "iphone",
platform: "OS X 10.10",
version: "8.1"
}
}
config.set(_.merge({
reporters: ['saucelabs'],
port: 9876,
colors: true,
plugins: [ require('karma-sauce-launcher') ],
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
sauceLabs: {
testName: 'xmock',
recordScreenshots: false,
build: require('./package.json').version + ' - ' + process.env.TRAVIS_BUILD_NUMBER,
tags: ['mock', 'xhr', 'http'],
connectOptions: {
port: 5757,
logfile: 'sauce_connect.log'
},
public: 'public'
},
captureTimeout: 120000,
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers),
}, baseConf));
}