grunt-selenium-server
Advanced tools
Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "grunt-selenium-server", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Grunt task to start/stop a local Selenium standalon server.", | ||
@@ -9,11 +9,15 @@ "main": "Gruntfile.js", | ||
"repository": "git@github.com:pifantastic/grunt-selenium-server.git", | ||
"dependencies": { | ||
"request": "~2.27.0", | ||
"progress": "~1.1.2" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-cli": "^0.1.13", | ||
"grunt-contrib-jshint": "~0.7.0", | ||
"grunt-contrib-nodeunit": "~0.2.2" | ||
}, | ||
"dependencies": { | ||
"request": "~2.27.0", | ||
"progress": "~1.1.2" | ||
"scripts": { | ||
"test": "grunt test" | ||
} | ||
} |
@@ -21,2 +21,6 @@ var fs = require('fs'); | ||
function getDestination(options) { | ||
return path.join(options.downloadLocation, path.basename(options.downloadUrl)); | ||
} | ||
/** | ||
@@ -30,3 +34,3 @@ * Download the Selenium Server jar file. | ||
// Where to save jar to. | ||
var destination = path.join(options.downloadLocation, path.basename(options.downloadUrl)); | ||
var destination = getDestination(options); | ||
@@ -83,2 +87,6 @@ // If it's already there don't download it. | ||
function deleteJar(options, cb) { | ||
fs.unlink(getDestination(options), cb); | ||
} | ||
/** | ||
@@ -122,6 +130,17 @@ * Start a selenium server. | ||
var str = data.toString(); | ||
if (str.match(/^Error: /) || str.match(/Selenium is already running/)) { | ||
var errRegex = /^Error: /; | ||
if (str.match(/Selenium is already running/)) { | ||
cb(new Error(str)); | ||
} | ||
if (str.match(/Selenium Server is up and running/) || str.match(/Started SocketListener on .+:\d+/)) { | ||
} else if (str.match(errRegex)) { | ||
str = str.replace(errRegex, ''); | ||
if (str.match(/^Invalid or corrupt jarfile /)) { | ||
deleteJar(options, function(err) { | ||
if (err) | ||
return cb(err); | ||
cb(new Error(str)); | ||
}); | ||
} else { | ||
cb(new Error(str)); | ||
} | ||
} else if (str.match(/Selenium Server is up and running/) || str.match(/Started SocketListener on .+:\d+/)) { | ||
if (complete) { | ||
@@ -128,0 +147,0 @@ return; |
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
11425
7
236
4