Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
grunt-selenium-server
Advanced tools
Start/stop a local Selenium standalon server.
npm install grunt-selenium-server --save-dev
grunt.loadNpmTasks('grunt-selenium-server');
Grunt config example (with default options):
'start-selenium-server': {
dev: {
options: {
downloadUrl: 'https://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar',
downloadLocation: '/tmp',
serverOptions: {},
systemProperties: {}
}
}
},
'stop-selenium-server': {
dev: {
}
}
Grunt task example:
grunt.registerTask('devUI', 'run selenium server and phpunit', function(){
grunt.task.run(['start-selenium-server:dev', 'phpunit:dev', 'stop-selenium-server:dev']);
});
Run:
grunt devUI
Kill selenium in case your grunt tasks fails before we reach 'stop-selenium-server':
var seleniumChildProcesses = {};
grunt.event.on('selenium.start', function(target, process){
grunt.log.ok('Saw process for target: ' + target);
seleniumChildProcesses[target] = process;
});
grunt.util.hooker.hook(grunt.fail, function(){
// Clean up selenium if we left it running after a failure.
grunt.log.writeln('Attempting to clean up running selenium server.');
for(var target in seleniumChildProcesses) {
grunt.log.ok('Killing selenium target: ' + target);
try {
seleniumChildProcesses[target].kill('SIGTERM');
}
catch(e) {
grunt.log.warn('Unable to stop selenium target: ' + target);
}
}
});
If you won't handle this event, if your phpunit (for example) will fail the selenium server process will remain active in the background.
The "grunt.fail" event will be fired whenever any grunt task is failing. Thus you might want to consider using a more specific event related to the task that actually uses selenium server. i.e phpunit in the above example.
FAQs
Grunt task to start/stop a local Selenium standalon server.
The npm package grunt-selenium-server receives a total of 4 weekly downloads. As such, grunt-selenium-server popularity was classified as not popular.
We found that grunt-selenium-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.