Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to exit automatically #13

Open
conradz opened this issue Apr 23, 2014 · 13 comments
Open

Add option to exit automatically #13

conradz opened this issue Apr 23, 2014 · 13 comments

Comments

@conradz
Copy link

conradz commented Apr 23, 2014

I would love an option for prova to automatically exit when it gets the test results from a browser. This would let me run prova automatically on every commit in a continuous integration server, and could be useful for running browser tests with npm test, which most people are used to.

Maybe something like prova test.js -b -l chrome -q, which would launch chrome to run the tests. When the test results are received, prova would kill chrome and exit with status code of zero if the tests succeeded and non-zero if the tests failed.

Currently it is very close to being able to use in a CI environment for browser tests, but not quite without being able to exit automatically.

@bclinkinbeard
Copy link
Contributor

I came here to request this. :) I don't think it should be limited to headless though, it would be nice to run and exit on any supported browser.

@conradz
Copy link
Author

conradz commented Apr 25, 2014

@bclinkinbeard 👍 Good idea, not sure why I thought it would only be useful in headless. Will change description to be more clear.

@conradz conradz changed the title Add option to exit automatically when running headless Add option to exit automatically Apr 25, 2014
@azer
Copy link
Owner

azer commented Apr 26, 2014

added and released as 1.6.0.

@azer azer closed this as completed Apr 26, 2014
@bclinkinbeard
Copy link
Contributor

Awesome! Though 1.6 isn't published according to npm.

@azer
Copy link
Owner

azer commented Apr 26, 2014

sorry, just published now :)

@bclinkinbeard
Copy link
Contributor

Awesome, thanks!

Not to keep being a pest, but shouldn't the browser be closed at the end as well? Right now the test process exits but the browser remains open.

@azer azer reopened this Apr 26, 2014
@azer
Copy link
Owner

azer commented Apr 26, 2014

you're right, we also need to kill the browser process (it actually does in linux). Any ideas on it?

@bclinkinbeard
Copy link
Contributor

I only glanced at the code but it looked like browser-launcher passes the process to cb, so would guess it could be killed that way?

On Sat, Apr 26, 2014 at 2:40 PM, Azer Koçulu [email protected]
wrote:

you're right, we also need to kill the browser process (it actually does in linux). Any ideas on it?

Reply to this email directly or view it on GitHub:
#13 (comment)

@bclinkinbeard
Copy link
Contributor

The ps process passed to cb is for the script that opens the browser, not the browser itself. I haven't yet found a way to actually close the browser.

@bclinkinbeard
Copy link
Contributor

https://github.com/juliangruber/tape-run uses https://github.com/juliangruber/browser-run under the hood, which works to close the browser on my system. Maybe look for a solution there?

@bclinkinbeard
Copy link
Contributor

Hmm, tape-run only successfully closes PhantomJS for me. Chrome and Safari stay open, but even Phantom doesn't close for me with prova.

@azer
Copy link
Owner

azer commented Jun 16, 2014

@bclinkinbeard phantom should be closed if you pass -q, may be it should be default. but I don't have an answer to the other question, I'll ask this in browser-launcher repo

@bclinkinbeard
Copy link
Contributor

Ah, duh. :) I think there is something "off" with my system that prevents browsers from being closed. Feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants