Skip to content

Commit

Permalink
Update chromedriver to 2.36 and update tests for linux 32
Browse files Browse the repository at this point in the history
  • Loading branch information
WillBrock committed Mar 7, 2018
1 parent 93efc2f commit 83bc90f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
16 changes: 13 additions & 3 deletions lib/compute-download-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function computeDownloadUrls(opts, askedOpts) {
urls.chrome,
opts.drivers.chrome.baseURL,
opts.drivers.chrome.version,
getChromeDriverPlatform(opts.drivers.chrome.arch)
getChromeDriverArchitecture(opts.drivers.chrome.version, opts.drivers.chrome.arch)
);
}
if (opts.drivers.ie) {
Expand All @@ -80,14 +80,15 @@ function computeDownloadUrls(opts, askedOpts) {
if (opts.drivers.edge) {
downloadUrls.edge = getEdgeDriverUrl(opts.drivers.edge.version);
}

return downloadUrls;
}

function getChromeDriverPlatform(wantedArchitecture) {
function getChromeDriverArchitecture(version, wantedArchitecture) {
var platform;

if (process.platform === 'linux') {
platform = 'linux' + (wantedArchitecture === 'x64' ? '64' : '32');
platform = getLinuxChromeDriverArchitecture(version, wantedArchitecture);
} else if (process.platform === 'darwin') {
if (mac32) {
platform = 'mac32';
Expand Down Expand Up @@ -172,6 +173,15 @@ function getFirefoxDriverArchitecture(version, wantedArchitecture) {
}
}

function getLinuxChromeDriverArchitecture(version, wantedArchitecture) {
// Since 2.34, chromdriver support was dropped for linux 32
if(compareVersions(version, '2.34') >= 0 && wantedArchitecture !== 'x64') {
throw new Error('Only x64 architecture is available for chromdriver >= 2.34')
}

return 'linux' + (wantedArchitecture === 'x64' ? '64' : '32');
}

function getLinuxFirefoxDriverArchitecture(version, extension, wantedArchitecture) {
// Since 0.11.0, there is linux32 and linux64
if (compareVersions(version, '0.11.0') >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
version: '3.8.1',
drivers: {
chrome: {
version: '2.33',
version: '2.36',
arch: process.arch,
baseURL: 'https://chromedriver.storage.googleapis.com'
},
Expand Down
2 changes: 1 addition & 1 deletion test/compute-download-urls-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('compute-download-urls', function() {
});
});

it('x32', function() {
it('x32 for versions < 2.34', function() {
opts.drivers.chrome = {
baseURL: 'https://localhost',
version: '2.0',
Expand Down
15 changes: 1 addition & 14 deletions test/default-downloads-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,7 @@ describe('default-downloads', function() {
});
});

it('ia32 download exists', function(done) {
opts = merge(opts, {
drivers: {
chrome: {
arch: 'ia32'
}
}
});

computedUrls = computeDownloadUrls(opts);

assert(computedUrls.chrome.indexOf('linux32') > 0);
doesDownloadExist(computedUrls.chrome, done);
});
// No x32 for latest chromedriver on linux

it('x64 download exists', function(done) {
opts = merge(opts, {
Expand Down

0 comments on commit 83bc90f

Please sign in to comment.