Add command 'stop'
- selenium-standalone install
- selenium-standalone start
- some work
- selenium-standalone stop
@alexpts The start command do not goes into background so there's no need for a "stop" you can just CTRL+C to end it.
Can you precise a little more your usecase or how do you see it.
Add command
"Stop"
Date: Fri, 18 Sep 2015 05:48:31 -0700 From: [email protected] To: [email protected] Subject: Re: [selenium-standalone] Add command 'stop' (#132)
@alexpts The start command do not goes into background so there's no need for a "stop" you can just CTRL+C to end it.
Can you precise a little more your usecase or how do you see it.
— Reply to this email directly or view it on GitHub.
selenium-standalone is not a background process so there's no need for a stop command
It is not possible to use it as a daemon.
Will accept a PR to run it as a daemon but why would you want to run it as a daemon?
You can use any unix tool to make it so
@vvo
but why would you want to run it as a daemon?
I'm using nightwatch and this package seems like the best way to automate installation of selenium for other people cloning my app since I can just add it to the dev-dependencies.
I can configure nightwatch to start selenium using the API this package provides but without a stop command I cannot kill it after tests end.
I can configure nightwatch to start selenium using the API this package provides but without a stop command I cannot kill it after tests end.
@nicooga I think you can do that with the child argument that the callback uses. See https://github.com/vvo/selenium-standalone#seleniumstartopts-cb
The unit tests for selenium-standalone use that for stopping the selenium process. Take a look at https://github.com/vvo/selenium-standalone/blob/baf462261ae86d401f369d1c76542fcb3b7be3af/test/programmatic.js#L32-L41
@stephenash thanks, I should have just read the docs. I "promiseified" start and stop in order to be able to parallelize the setup of my test suite with Promise.all. Here is what I ended with in case anyone finds it useful:
const selenium = require('selenium-standalone');
module.exports = {
start() {
return new Promise((fulfill, reject) =>
selenium.start((err, cp) => {
if (err) reject(err);
else {
this.seleniumProcess = cp;
fulfill();
}
})
);
},
stop() {
this.seleniumProcess && this.seleniumProcess.kill();
return Promise.resolve();
}
};