chromedriver 2.43.4 → 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)
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;
@@ -71,6 +75,7 @@ function downloadFile() {
71
75
  if (configuredfilePath) {
72
76
  downloadedFile = configuredfilePath;
73
77
  console.log('Using file: ', downloadedFile);
78
+ return Promise.resolve();
74
79
  } else {
75
80
  const fileName = `chromedriver_${platform}.zip`;
76
81
  const tempDownloadedFile = path.resolve(tmpPath, fileName);
@@ -108,7 +113,7 @@ function verifyIfChromedriverIsAvailableAndHasCorrectVersion() {
108
113
  return deferred.resolve(false);
109
114
  if (parts[1].startsWith(chromedriver_version)) {
110
115
  console.log(str);
111
- console.log('ChromeDriver is already available!');
116
+ console.log(`ChromeDriver is already available at '${chromedriverBinaryFilePath}'.`);
112
117
  return deferred.resolve(true);
113
118
  }
114
119
  deferred.resolve(false);
@@ -131,7 +136,9 @@ function findSuitableTempDirectory() {
131
136
 
132
137
  for (let i = 0; i < candidateTmpDirs.length; i++) {
133
138
  if (!candidateTmpDirs[i]) continue;
134
- 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');
135
142
  try {
136
143
  mkdirp.sync(candidatePath, '0777');
137
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.43';
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.43.4",
3
+ "version": "2.46.0",
4
4
  "keywords": [
5
5
  "chromedriver",
6
6
  "selenium"