chromedriver 2.45.0 → 2.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ChromeDriver
2
2
 
3
- [![Build status](https://travis-ci.org/giggio/node-chromedriver.svg)](https://travis-ci.org/giggio/node-chromedriver/) [![Build status](https://ci.appveyor.com/api/projects/status/wr4c16rs5q113vy3?svg=true)](https://ci.appveyor.com/project/giggio/node-chromedriver) [![Build Status](https://api.shippable.com/projects/5c01ad17718ee50700de68bc/badge?branch=master)]()
3
+ [![Build status](https://travis-ci.org/giggio/node-chromedriver.svg)](https://travis-ci.org/giggio/node-chromedriver/) [![Build status](https://ci.appveyor.com/api/projects/status/wr4c16rs5q113vy3?svg=true)](https://ci.appveyor.com/project/giggio/node-chromedriver) [![Build Status](https://api.shippable.com/projects/5c01ad17718ee50700de68bc/badge?branch=master)](https://app.shippable.com/github/giggio/node-chromedriver/runs?branchName=master)
4
4
  [![npm](https://img.shields.io/npm/dt/chromedriver.svg)](https://www.npmjs.com/package/chromedriver)
5
5
 
6
6
  An NPM wrapper for Selenium [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/).
package/install.js CHANGED
@@ -44,15 +44,19 @@ if (platform === 'linux') {
44
44
  console.log('Unexpected platform or architecture:', process.platform, process.arch);
45
45
  process.exit(1);
46
46
  }
47
- const tmpPath = findSuitableTempDirectory();
47
+ let tmpPath;
48
48
  const chromedriverBinaryFileName = process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver';
49
- const chromedriverBinaryFilePath = path.resolve(tmpPath, chromedriverBinaryFileName );
49
+ let chromedriverBinaryFilePath;
50
50
  let downloadedFile = '';
51
51
 
52
52
  Promise.resolve().then(function () {
53
53
  if (chromedriver_version === 'LATEST')
54
54
  return getLatestVersion(getRequestOptions(cdnUrl + '/LATEST_RELEASE'));
55
55
  })
56
+ .then(() => {
57
+ tmpPath = findSuitableTempDirectory();
58
+ chromedriverBinaryFilePath = path.resolve(tmpPath, chromedriverBinaryFileName );
59
+ })
56
60
  .then(verifyIfChromedriverIsAvailableAndHasCorrectVersion)
57
61
  .then(chromedriverIsAvailable => {
58
62
  if (chromedriverIsAvailable) return;
@@ -132,7 +136,9 @@ function findSuitableTempDirectory() {
132
136
 
133
137
  for (let i = 0; i < candidateTmpDirs.length; i++) {
134
138
  if (!candidateTmpDirs[i]) continue;
135
- const candidatePath = path.join(candidateTmpDirs[i], 'chromedriver');
139
+ // Prevent collision with other versions in the dependency tree
140
+ const namespace = chromedriver_version;
141
+ const candidatePath = path.join(candidateTmpDirs[i], namespace, 'chromedriver');
136
142
  try {
137
143
  mkdirp.sync(candidatePath, '0777');
138
144
  const testFile = path.join(candidatePath, now + '.tmp');
@@ -17,7 +17,7 @@ function getPortFromArgs(args) {
17
17
  }
18
18
  process.env.PATH = path.join(__dirname, 'chromedriver') + path.delimiter + process.env.PATH;
19
19
  exports.path = process.platform === 'win32' ? path.join(__dirname, 'chromedriver', 'chromedriver.exe') : path.join(__dirname, 'chromedriver', 'chromedriver');
20
- exports.version = '2.45';
20
+ exports.version = '2.46';
21
21
  exports.start = function(args, returnPromise) {
22
22
  let command = exports.path;
23
23
  if (!fs.existsSync(command)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chromedriver",
3
- "version": "2.45.0",
3
+ "version": "2.46.0",
4
4
  "keywords": [
5
5
  "chromedriver",
6
6
  "selenium"