forked from lucidsoftware/closure-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
browser_capabilities.js
32 lines (27 loc) · 956 Bytes
/
browser_capabilities.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
var sauceBrowsers = require('./sauce_browsers.json');
function getBrowserName(browserCap) {
var name = browserCap.browserName == 'internet explorer' ?
'ie' :
browserCap.browserName;
var version = browserCap.version || '-latest';
return name + version;
}
function getJobName(browserCap) {
var browserName = getBrowserName(browserCap);
return process.env.TRAVIS_PULL_REQUEST == 'false' ?
'CO-' + process.env.TRAVIS_BRANCH + '-' + browserName :
'PR-' + process.env.TRAVIS_PULL_REQUEST + '-' + browserName + '-' +
process.env.TRAVIS_BRANCH;
}
function getBrowserCapabilities(browsers) {
var caps = [];
for (var i = 0; i < browsers.length; i++) {
var b = browsers[i];
b['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
b['build'] = process.env.TRAVIS_BUILD_NUMBER;
b['name'] = getJobName(b);
caps.push(b);
}
return caps;
}
module.exports = getBrowserCapabilities(sauceBrowsers);