selenium-standalone
Advanced tools
Comparing version 2.39.0-2.9.0 to 2.40.0-2.9.0
var path = require('path'); | ||
// see https://code.google.com/p/selenium/downloads/list for latest | ||
var version = '2.39.0'; | ||
// see http://selenium-release.storage.googleapis.com/index.html for latest | ||
var version = '2.40.0'; | ||
@@ -6,0 +6,0 @@ module.exports = { |
@@ -9,3 +9,4 @@ var conf = require('./conf.js'); | ||
setup, | ||
download | ||
download, | ||
chmodChromeDr.bind(null, conf.chromeDr.path) | ||
], end); | ||
@@ -28,2 +29,3 @@ | ||
function end(err) { | ||
console.log('Installation finished'); | ||
if (err) { | ||
@@ -35,22 +37,29 @@ throw err | ||
function installSelenium(to, version, cb) { | ||
var seleniumStandaloneUrl = 'https://selenium.googlecode.com/files/selenium-server-standalone-%s.jar' | ||
var util = require('util'); | ||
var dl = util.format(seleniumStandaloneUrl, version); | ||
var request = require('request'); | ||
var fs = require('fs'); | ||
var destination = fs.createWriteStream(to); | ||
var seleniumStandaloneUrl = | ||
'http://selenium-release.storage.googleapis.com/%s/selenium-server-standalone-%s.jar'; | ||
destination.on('error', cb); | ||
destination.on('close', cb); | ||
var dl = require('util').format(seleniumStandaloneUrl, | ||
version.slice(0, version.lastIndexOf('.')), | ||
version); | ||
console.log('Downloading ' + dl); | ||
request(dl) | ||
.on('error', cb) | ||
.pipe(destination); | ||
getDownloadStream(dl, function(err, stream) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
stream | ||
.pipe(require('fs').createWriteStream(to)) | ||
.once('error', cb.bind(null, new Error('Could not write to ' + to))) | ||
.once('finish', cb); | ||
}); | ||
} | ||
function chmodChromeDr(where, cb) { | ||
console.log('chmod+x chromedriver'); | ||
require('fs').chmod(where, 0755, cb); | ||
} | ||
function installChromeDr(to, version, cb) { | ||
var path = require('path'); | ||
var util = require('util'); | ||
var request = require('request'); | ||
@@ -66,4 +75,3 @@ var chromedriverUrl = 'http://chromedriver.storage.googleapis.com/%s/chromedriver_%s.zip'; | ||
console.log('Downloading ' + dl); | ||
downloadAndExtractZip(dl, to, function(err) { | ||
getDownloadStream(dl, function(err, stream) { | ||
if (err) { | ||
@@ -73,22 +81,34 @@ return cb(err); | ||
var fs = require('fs'); | ||
fs.chmod(to, '0755', cb); | ||
}); | ||
var unzip = require('unzip'); | ||
console.log('Unzipping ' + dl); | ||
stream | ||
.pipe(require('unzip').Parse()) | ||
.once('entry', function(file) { | ||
file | ||
.pipe(require('fs').createWriteStream(to)) | ||
.once('error', cb.bind(null, new Error('Could not write to ' + to))) | ||
.once('finish', cb) | ||
}) | ||
.once('error', cb.bind(null, new Error('Could not unzip ' + dl))) | ||
}) | ||
} | ||
function downloadAndExtractZip(from, to, cb) { | ||
var fs = require('fs'); | ||
var request = require('request'); | ||
var unzip = require('unzip'); | ||
var destination = fs.createWriteStream(to); | ||
function getDownloadStream(dl, cb) { | ||
var r = | ||
require('http') | ||
.request(dl, function(res) { | ||
console.log('Downloading ' + dl); | ||
destination.on('close', cb); | ||
destination.on('error', cb); | ||
if (res.statusCode !== 200) { | ||
return cb(new Error('Could not download ' + dl)); | ||
} | ||
request(from) | ||
.on('error', cb) | ||
.pipe(unzip.Parse()) | ||
.once('entry', function(file) { | ||
file.pipe(destination); | ||
}) | ||
cb(null, res); | ||
}) | ||
.once('error', cb.bind(null, new Error('Could not download ' + dl))) | ||
// initiate request | ||
r.end(); | ||
} | ||
@@ -95,0 +115,0 @@ |
{ | ||
"name": "selenium-standalone", | ||
"version": "2.39.0-2.9.0", | ||
"version": "2.40.0-2.9.0", | ||
"description": "installs a `start-selenium` command line to start a standalone selenium server with chrome-driver", | ||
"dependencies": { | ||
"request": "~2.27.0", | ||
"unzip": "~0.1.9", | ||
"async": "~0.2.9", | ||
"async": "~0.2.10", | ||
"mkdirp": "~0.3.5", | ||
"rimraf": "~2.2.2" | ||
"rimraf": "~2.2.6" | ||
}, | ||
@@ -22,5 +21,5 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mocha": "~1.16.2", | ||
"faucet": "0.0.0" | ||
"mocha": "~1.17.1", | ||
"faucet": "0.0.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# selenium-standalone | ||
# selenium-standalone [![Dependency Status](https://david-dm.org/vvo/selenium-standalone.svg?theme=shields.io)](https://david-dm.org/vvo/selenium-standalone) [![devDependency Status](https://david-dm.org/vvo/selenium-standalone/dev-status.svg?theme=shields.io)](https://david-dm.org/vvo/selenium-standalone#info=devDependencies) | ||
@@ -6,6 +6,6 @@ Intalls a `start-selenium` command line starting a selenium standalone | ||
Currently installs selenium `2.39.0` and chrome driver `2.8`. | ||
Currently installs selenium `2.40.0` and chrome driver `2.9`. | ||
```shell | ||
npm install --production selenium-standalone -g | ||
npm install --production selenium-standalone@latest -g | ||
start-selenium | ||
@@ -12,0 +12,0 @@ ``` |
describe('programmatic use', function () { | ||
it('should start', function(done) { | ||
this.timeout(100000); | ||
this.timeout(20000); | ||
var selenium = require('./index.js'); | ||
@@ -5,0 +5,0 @@ var proc = selenium.start({ stdio: 'pipe' }); |
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
Network access
Supply chain riskThis module accesses the network.
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
8719
4
160
2
- Removedrequest@~2.27.0
- Removedasn1@0.1.11(transitive)
- Removedassert-plus@0.1.5(transitive)
- Removedasync@0.9.2(transitive)
- Removedaws-sign@0.3.0(transitive)
- Removedboom@0.4.2(transitive)
- Removedcombined-stream@0.0.7(transitive)
- Removedcookie-jar@0.3.0(transitive)
- Removedcryptiles@0.2.2(transitive)
- Removedctype@0.5.3(transitive)
- Removeddelayed-stream@0.0.5(transitive)
- Removedforever-agent@0.5.2(transitive)
- Removedform-data@0.1.4(transitive)
- Removedhawk@1.0.0(transitive)
- Removedhoek@0.9.1(transitive)
- Removedhttp-signature@0.10.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedmime@1.2.11(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedoauth-sign@0.3.0(transitive)
- Removedqs@0.6.6(transitive)
- Removedrequest@2.27.0(transitive)
- Removedsntp@0.2.4(transitive)
- Removedtunnel-agent@0.3.0(transitive)
Updatedasync@~0.2.10
Updatedrimraf@~2.2.6