Skip to content

Commit

Permalink
update browser platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Jan 24, 2016
1 parent 96e4604 commit e947f01
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 42 deletions.
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ cache:
- node_modules
env:
matrix:
- CXX=g++-4.8 TEST=unit-mac-chrome
- CXX=g++-4.8 TEST=unit-mac-firefox
- CXX=g++-4.8 TEST=unit-mac-safari
- CXX=g++-4.8 TEST=unit-windows-chrome
- CXX=g++-4.8 TEST=unit-windows-firefox
- CXX=g++-4.8 TEST=unit-windows-ms-edge
- CXX=g++-4.8 TEST=unit-windows-ie-11
- CXX=g++-4.8 TEST=unit-linux-chrome
- CXX=g++-4.8 TEST=unit-linux-firefox
- CXX=g++-4.8 TEST=unit-ipad
- CXX=g++-4.8 TEST=unit-iphone
- CXX=g++-4.8 TEST=unit-android
- CXX=g++-4.8 TEST=mac-chrome-latest
- CXX=g++-4.8 TEST=mac-firefox-latest
- CXX=g++-4.8 TEST=mac-safari-latest
- CXX=g++-4.8 TEST=windows-chrome-latest
- CXX=g++-4.8 TEST=windows-firefox-latest
- CXX=g++-4.8 TEST=windows-microsoftedge-latest
- CXX=g++-4.8 TEST=windows-ie-latest
- CXX=g++-4.8 TEST=linux-chrome-latest
- CXX=g++-4.8 TEST=linux-firefox-latest
- CXX=g++-4.8 TEST=ios-latest
- CXX=g++-4.8 TEST=android-latest
81 changes: 61 additions & 20 deletions config/browsers.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,66 @@
var CHROME_VERSION = '47';
var FIREFOX_VERSION = '43';
var SAFARI_VERSION = '9';
var IOS_VERSION = '9.2'; // Add space prefix when decimal is 0
var ANDROID_VERSION = '5.1'; // Workaround for optimist converting to float
var _ = require('lodash');

var browsers = {
'mac-chrome' : ['Mac 10.11', 'chrome', CHROME_VERSION],
'mac-firefox' : ['Mac 10.11', 'firefox', FIREFOX_VERSION],
'mac-safari' : ['Mac 10.11', 'safari', SAFARI_VERSION],

'windows-chrome' : ['Windows 10', 'chrome', CHROME_VERSION],
'windows-firefox' : ['Windows 10', 'firefox', FIREFOX_VERSION],
'windows-ms-edge' : ['Windows 10', 'microsoftedge', '20.10240'],
'windows-ie-11' : ['Windows 8.1', 'internet explorer', '11'],

'linux-chrome' : ['Linux', 'chrome', CHROME_VERSION],
'linux-firefox' : ['Linux', 'firefox', FIREFOX_VERSION],
var desktop = {
'chrome': {
'47.0': ['Mac 10.11', 'Windows 10', 'Linux'],
'46.0': ['Mac 10.10', 'Windows 8.1', 'Linux']
},
'firefox': {
'43.0': ['Mac 10.11', 'Windows 10', 'Linux'],
'42.0': ['Mac 10.10', 'Windows 8.1', 'Linux']
},
'safari': {
'9.0': ['Mac 10.11'],
'8.0': ['Mac 10.10']
},
'internet explorer': {
'11.0': ['Windows 10']
},
'microsoftedge': {
'20.10240': ['Windows 10']
}
};

'iphone' : ['Mac 10.10', 'iphone', IOS_VERSION],
'ipad' : ['Mac 10.10', 'ipad', IOS_VERSION],
'android' : ['Linux', 'android', ANDROID_VERSION]
var mobile = {
'iOS': {
'9.2': ['iPhone 6 Plus', 'Safari'],
'9.1': ['iPhone 6 Plus', 'Safari']
},
'Android': {
'4.4': ['Google Nexus 7 HD Emulator', 'Browser'],
'4.3': ['Google Nexus 7 HD Emulator', 'Browser']
}
};

module.exports = browsers;
var desktopCapabilities = _.forEach(desktop, function(config, browser) {
_.forEach(_.keys(config), function(version, i) {
var descriptor = i === 0 ? 'latest' : 'previous';
_.forEach(config[version], function(platform) {
var key = _.kebabCase([platform.split(' ')[0], browser, descriptor].join('-').toLowerCase());
module.exports[key] = {
base: 'SauceLabs',
browserName: browser,
version: version,
platform: platform
}
});
});
});

var mobileCapabilities = _.forEach(mobile, function(config, platform) {
_.forEach(Object.keys(config), function(version, i) {
var device = config[version][0], browser = config[version][1];
var descriptor = i === 0 ? 'latest' : 'previous';
var key = _.kebabCase([platform, descriptor].join('-').toLowerCase());
module.exports[key] = {
base: 'SauceLabs',
browserName: browser,
appiumVersion: '1.4.16',
deviceName: device,
deviceOrientation: 'portrait',
platformVersion: version,
platformName: platform
};
});
});
10 changes: 1 addition & 9 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ module.exports = function(config) {
accessKey: sauce.accessKey,
tunnelIdentifier: sauce.tunnel
},
customLaunchers: _.reduce(browsers, function(memo, browser, name) {
memo[name] = {
base: 'SauceLabs',
platform: browser[0],
browserName: browser[1],
version: browser[2]
};
return memo;
}, {})
customLaunchers: browsers
});
if (process.env.TRAVIS) {
config.transports = ['polling'];
Expand Down
2 changes: 1 addition & 1 deletion config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function(config) {
});

Object.keys(browsers).forEach(function(browser) {
gulp.task('remote:unit-' + browser, ['build', 'server'], function(callback) {
gulp.task('remote:' + browser, ['build', 'server'], function(callback) {
new karma.Server(_.defaults({
browsers: [browser],
browserDisconnectTimeout: 10000,
Expand Down

0 comments on commit e947f01

Please sign in to comment.