forked from swisnl/jQuery-contextMenu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma-saucelabs.conf.js
88 lines (74 loc) · 2.74 KB
/
karma-saucelabs.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
module.exports = function (config) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.')
process.exit(1)
}
var testedCapabilities = {};
var browsers = [];
var capabilities = {
'Windows 7': {
'internet explorer': ['11', '10', '9'],
},
'Windows 10': {
'firefox': ['latest', 'latest-1'],
'chrome': ['latest', 'latest-1'],
'MicrosoftEdge': ['latest']
},
'macOS 10.12': {
'firefox': ['latest'],
'chrome': ['latest'],
'safari': ['latest']
}
};
var buildDate = new Date().toISOString();
for (var osVersion in capabilities) {
for (var browserKey in capabilities[osVersion]) {
for(var i=0; i< capabilities[osVersion][browserKey].length; i++){
var browserVersion = capabilities[osVersion][browserKey][i];
testedCapabilities[osVersion + ' ' + browserKey + ' ' + browserVersion] = {
base: 'SauceLabs',
platform: osVersion,
browserName: browserKey,
version: browserVersion,
name: osVersion + ' ' + browserKey + ' ' + browserVersion,
build: buildDate
};
}
if(browsers.indexOf(browserKey) == -1){
browsers.push(browsers);
}
}
}
config.set({
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['qunit'],
// list of files / patterns to load in the browser
files: [
// dependencies
{ pattern: 'node_modules/jquery/dist/jquery.js', watched: false, served: true, included: true },
{ pattern: 'src/jquery.ui.position.js', watched: false, served: true, included: true },
{ pattern: 'src/jquery.contextMenu.js', watched: false, served: true, included: true },
// test modules
'test/unit/*.js'
],
reporters: ['dots', 'saucelabs'],
port: 9876,
colors: true,
sauceLabs: {
testName: 'jQuery contextMenu saucelabs',
recordScreenshots: false,
connectOptions: {
port: 5757,
logfile: 'sauce_connect.log'
},
public: 'public'
},
// Increase timeout in case connection in CI is slow
captureTimeout: 600000,
customLaunchers: testedCapabilities,
browsers: Object.keys(testedCapabilities),
singleRun: true
})
}