selenium-standalone
Advanced tools
Comparing version 2.35.0 to 2.37.0
var path = require('path'); | ||
// see https://code.google.com/p/selenium/downloads/list for latest | ||
var version = '2.35.0'; | ||
var version = '2.37.0'; | ||
@@ -13,5 +13,5 @@ module.exports = { | ||
path: path.join(__dirname, '.selenium', version, 'chromedriver'), | ||
// see https://code.google.com/p/chromedriver/downloads/list | ||
v: '2.3' | ||
// see http://chromedriver.storage.googleapis.com/index.html | ||
v: '2.4' | ||
} | ||
}; |
var conf = require('./conf.js'); | ||
var async = require('async'); | ||
var mkdirp = require('mkdirp'); | ||
var rimraf = require('rimraf'); | ||
var path = require('path'); | ||
async.parallel([ | ||
installChromeDr.bind(null, conf.chromeDr.path, conf.chromeDr.v), | ||
installSelenium.bind(null, conf.selenium.path, conf.selenium.v) | ||
], function(err) { | ||
async.series([ | ||
setup, | ||
download | ||
], end); | ||
function setup(cb) { | ||
async.series([ | ||
rimraf.bind(null, path.join(__dirname, '.selenium')), | ||
mkdirp.bind(null, path.dirname(conf.selenium.path)) | ||
], cb); | ||
} | ||
function download(cb) { | ||
async.parallel([ | ||
installChromeDr.bind(null, conf.chromeDr.path, conf.chromeDr.v), | ||
installSelenium.bind(null, conf.selenium.path, conf.selenium.v) | ||
], cb) | ||
} | ||
function end(err) { | ||
if (err) { | ||
throw err | ||
} | ||
}); | ||
} | ||
@@ -18,7 +37,4 @@ function installSelenium(to, version, cb) { | ||
var request = require('request'); | ||
var fstream = require('fstream'); | ||
var destination = fstream.Writer({ | ||
path: to, | ||
type: 'File' | ||
}); | ||
var fs = require('fs'); | ||
var destination = fs.createWriteStream(to); | ||
@@ -37,4 +53,5 @@ destination.on('error', cb); | ||
var util = require('util'); | ||
var request = require('request'); | ||
var chromedriverUrl = 'https://chromedriver.googlecode.com/files/chromedriver_%s_%s.zip'; | ||
var chromedriverUrl = 'http://chromedriver.storage.googleapis.com/%s/chromedriver_%s.zip'; | ||
var platform = getChromeDriverPlatform(); | ||
@@ -46,6 +63,6 @@ | ||
var dl = util.format(chromedriverUrl, platform, version); | ||
var dl = util.format(chromedriverUrl, version, platform); | ||
console.log('Downloading ' + dl); | ||
downloadAndExtractZip(dl, path.dirname(to), function(err) { | ||
downloadAndExtractZip(dl, to, function(err) { | ||
if (err) { | ||
@@ -61,9 +78,6 @@ return cb(err); | ||
function downloadAndExtractZip(from, to, cb) { | ||
var fstream = require('fstream'); | ||
var fs = require('fs'); | ||
var request = require('request'); | ||
var unzip = require('unzip'); | ||
var destination = fstream.Writer({ | ||
path: to, | ||
type: 'Directory' | ||
}); | ||
var destination = fs.createWriteStream(to); | ||
@@ -76,3 +90,5 @@ destination.on('close', cb); | ||
.pipe(unzip.Parse()) | ||
.pipe(destination) | ||
.once('entry', function(file) { | ||
file.pipe(destination); | ||
}) | ||
} | ||
@@ -79,0 +95,0 @@ |
{ | ||
"name": "selenium-standalone", | ||
"version": "2.35.0", | ||
"version": "2.37.0", | ||
"description": "installs a `start-selenium` command line to start a standalone selenium server with chrome-driver", | ||
@@ -9,3 +9,4 @@ "dependencies": { | ||
"async": "~0.2.9", | ||
"fstream": "~0.1.24" | ||
"mkdirp": "~0.3.5", | ||
"rimraf": "~2.2.2" | ||
}, | ||
@@ -12,0 +13,0 @@ "bin": { |
@@ -9,6 +9,16 @@ # selenium-standalone | ||
```shell | ||
npm install start-selenium -g | ||
npm install selenium-standalone -g | ||
start-selenium | ||
``` | ||
`selenium-standalone` versions maps `selenium` versions. | ||
## Example: launch www.google.com | ||
Using a selenium driver like [wd](https://github.com/admc/wd): | ||
```shell | ||
npm install wd -g | ||
wd shell | ||
(wd): browser = wd.remote(); browser.init(function(){browser.get('http://www.google.com')}) | ||
``` | ||
`selenium-standalone` versions maps `selenium` versions. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5260
98
24
5
+ Addedmkdirp@~0.3.5
+ Addedrimraf@~2.2.2
+ Addedmkdirp@0.3.5(transitive)
+ Addedrimraf@2.2.8(transitive)
- Removedfstream@~0.1.24
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedinflight@1.0.6(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedwrappy@1.0.2(transitive)