groupon / selenium-download

allow downloading of latest selenium standalone server and chromedriver
BSD 3-Clause "New" or "Revised" License
28 stars 25 forks source link

ensure() is not downloading the latest version. #40

Closed rober710 closed 6 years ago

rober710 commented 7 years ago

I'm using this script to download Selenium binaries in my project:

const selenium = require('selenium-download');
const path = require('path');

selenium.ensure(path.join(__dirname, 'bin'), function (err) {
    if (err) {
        console.error(err.stack);
        process.exit(0);
    }
});

However, it is downloading the Selenium standalone jar version 3.3.0 although version 3.4.0 is available in the repository:

[testium] grabbing selenium chromedriver 2.30
[testium] grabbing selenium standalone server 3.3.0

I checked the URL the script is getting the version information, and the latest version is the second to last CommonPrefixes element:

<CommonPrefixes>
  <Prefix>3.3/</Prefix>
</CommonPrefixes>
<CommonPrefixes>
  <Prefix>3.4/</Prefix>
</CommonPrefixes>
<CommonPrefixes>
  <Prefix>icons/</Prefix>
</CommonPrefixes>

Why in this commit you get the previous one?

var prefix = prefixes[prefixes.length - 3];

When I change the code to prefixes.length - 2 it downloads the correct version. Right now, the latest Gekodriver (0.17.0) is not working with the "latest" standalone server 3.3.0, so I had to download it manually.

Version info: npm version 5.0.3, node v8.1.2. selenium-download version v2.0.10 Created a pull request here: https://github.com/groupon/selenium-download/pull/39

Botono commented 6 years ago

Current version of standalone server is 3.8.1, but the module downloads 3.7.0.