forked from scotttrinh/angular-localForage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
100 lines (93 loc) · 2.53 KB
/
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
var customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '30'
},
sl_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.9',
version: '7'
},
sl_ios_safari: {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.9',
version: '7.1'
},
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'
}
};
module.exports = function(config) {
config.set(module.exports.conf);
if(process.env.TRAVIS) {
config.sauceUser = process.env.SAUCE_USERNAME;
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
var buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
config.logLevel = config.LOG_DEBUG;
config.transports = ['websocket', 'xhr-polling'];
config.captureTimeout = 0; // rely on SL timeout
config.sauceLabs.build = buildLabel;
config.sauceLabs.startConnect = false;
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
config.sauceLabs.recordScreenshots = true;
// TODO(vojta): remove once SauceLabs supports websockets.
// This speeds up the capturing a bit, as browsers don't even try to use websocket.
config.transports = ['xhr-polling'];
}
};
module.exports.conf = {
frameworks: ['jasmine'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'bower_components/localforage/dist/localforage.js',
'src/angular-localForage.js',
'tests/angular-localForage.js'
],
autoWatch: false,
singleRun: true,
sauceLabs: {
testName: 'angular-localforage unit tests',
recordScreenshots: false,
startConnect: true,
options: {
'selenium-version': '2.41.0'
},
connectOptions: {
port: 5757,
logfile: 'sauce_connect.log'
}
},
// Increase timeout in case connection in CI is slow
captureTimeout: 120000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 2,
browserNoActivityTimeout: 30000,
browsers: Object.keys(customLaunchers),
customLaunchers: customLaunchers,
reporters: ['progress', 'saucelabs'],
port: 9876,
colors: true
};