-
Notifications
You must be signed in to change notification settings - Fork 4
/
karma.conf-ci.js
149 lines (140 loc) · 3.51 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
var fs = require('fs')
, localConf = require('./karma.conf')
;
// karma for CI
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').username;
process.env.SAUCE_ACCESS_KEY = require('./sauce.json').accessKey;
}
}
// Browsers to run on Sauce Labs
var customLaunchers = {
// chrome, two versions back
'sl_chrome-latest': {
base: 'SauceLabs',
browserName: 'chrome',
version: '45'
},
'sl_chrome-1': {
base: 'SauceLabs',
browserName: 'chrome',
version: '44'
},
'sl_chrome-2': {
base: 'SauceLabs',
browserName: 'chrome',
version: '43'
},
// IE, back to IE9
'sl_ie-latest': {
base: 'SauceLabs',
browserName: 'microsoftedge',
},
'sl_ie-11': {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '11'
},
'sl_ie-10': {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '10'
},
'sl_ie-9': {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '9'
},
// Firefox, two versions back
'sl_firefox-latest': {
base: 'SauceLabs',
browserName: 'firefox',
version: '41'
},
'sl_firefox-1': {
base: 'SauceLabs',
browserName: 'firefox',
version: '40'
},
'sl_firefox-2': {
base: 'SauceLabs',
browserName: 'firefox',
version: '39'
},
// Safari, desktop, two versions back
'sl_safari-latest': {
base: 'SauceLabs',
browserName: 'safari',
version: '8'
},
'sl_safari-1': {
base: 'SauceLabs',
browserName: 'safari',
version: '7'
},
'sl_safari-2': {
base: 'SauceLabs',
browserName: 'safari',
version: '6'
},
// iOS, two versions back
'sl_ios-latest': {
base: 'SauceLabs',
browserName: 'iphone',
version: '8'
},
'sl_ios-1': {
base: 'SauceLabs',
browserName: 'iphone',
version: '7'
},
'sl_ios-2': {
base: 'SauceLabs',
browserName: 'iphone',
version: '6'
},
// Android, down to 4.3
'sl_android-latest': {
base: 'SauceLabs',
browserName: 'android',
version: '5.1'
},
'sl_android-1': {
base: 'SauceLabs',
browserName: 'android',
version: '4.3'
},
'sl_android-2': {
base: 'SauceLabs',
browserName: 'android',
version: '4.2'
}
};
localConf(config);
config.set({
sauceLabs: {
testName: 'Web Verse'
},
captureTimeout: 120000,
customLaunchers: customLaunchers,
reporters: ['dots', 'saucelabs', 'coverage', 'coveralls'],
preprocessors: {
'web-verse.js': ['coverage']
},
coverageReporter: {
type: 'lcov',
dir: 'coverage/'
},
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: Object.keys(customLaunchers),
singleRun: true
});
};