forked from caiogondim/fast-memoize.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
saucelabs.karma.conf.js
134 lines (125 loc) · 2.98 KB
/
saucelabs.karma.conf.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
// Config file used as example: https://github.com/angular/angular.js/blob/master/karma-shared.conf.js
var package = require('./package.json')
var debug = require('logdown')('Karma')
//
// SauceLabs conf
//
var sauceLabsConf = {
sauceLabs: {
testName: package.name,
username: process.env.SAUCELABS_USERNAME,
accessKey: process.env.SAUCELABS_ACCESS_KEY
},
concurrency: 1,
customLaunchers: {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest',
platform: 'OS X 10.11'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest',
platform: 'OS X 10.11'
},
'sl_safari_8': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.10',
version: '8'
},
sl_safari_9: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '9'
},
sl_ios_9: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '9.3',
deviceName: 'iPhone 6',
deviceOrientation: 'portrait'
},
sl_ios_8: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '8.4',
deviceName: 'iPhone 6',
deviceOrientation: 'portrait'
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 10',
version: '11'
},
sl_ie_10: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2012',
version: '10'
},
sl_ie_9: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2008',
version: '9'
},
sl_ie_8: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
},
}
}
//
// Export
//
module.exports = function(config) {
if (!process.env.SAUCELABS_USERNAME || !process.env.SAUCELABS_ACCESS_KEY) {
debug.error('Set env variables `SAUCELABS_USERNAME` and `SAUCELABS_ACCESS_KEY` with your SauceLabs credentials.')
throw new Error()
}
var confOptions = {
plugins: [
require('karma-webpack'),
require('karma-tap'),
require('karma-sauce-launcher')
],
basePath: '',
frameworks: [ 'tap' ],
files: [ 'test/*.js' ],
preprocessors: {
'test/*.js': [ 'webpack' ]
},
webpack: {
node : {
fs: 'empty'
}
},
webpackMiddleware: {
noInfo: true
},
reporters: ['dots', 'saucelabs'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: [],
singleRun: false,
// To avoid DISCONNECTED messages
browserDisconnectTimeout : 10000,
browserDisconnectTolerance : 1,
browserNoActivityTimeout : 60000,
}
// Add SauceLabs browsers
Object.assign(confOptions, sauceLabsConf)
confOptions.browsers.push(...Object.keys(sauceLabsConf.customLaunchers))
config.set(confOptions)
};