jberger / Mojo-Phantom

PhantomJS client-side testing for Mojolicious apps
Other
13 stars 6 forks source link

Allow user to specify command-line arguments for PhantomJS #2

Closed Eckankar closed 8 years ago

Eckankar commented 8 years ago

This pull-request introduces the argument arguments for Mojo::Phantom::Process and Mojo::Phantom, and phantom_args for Test::Mojo::Role::Phantom.

Their role is to pass command-line arguments directly to the PhantomJS process.

The motivation behind the pull-request is as follows:

We've found our PhantomJS tests to sometimes start failing an awful lot. After much debugging, we found out that deleting the contents of the PhantomJS local storage directory solves these problems, so we reckon it sometimes manages to get corrupted, messing up any future tests until it has been reset.

By calling PhantomJS with --local-storage-path, we can specify a clean directory to be used for each test, and avoid this problem cleanly.

jberger commented 8 years ago

Could you please include a test? I know I haven't quite gotten the test coverage I would like but I that doesn't mean I don't have ambitions :-P . If you want to go the mocking route I'd prefer Mock::MonkeyPatch.

Eckankar commented 8 years ago

:+1:

I've added a test that verifies that the --cookies-file argument is received correctly by PhantomJS.

jberger commented 8 years ago

I have moved this back to a branch (sorry for the force push people). The new test hangs for me and until I figure out why this shouldn't have been merged.

jberger commented 7 years ago

I have no idea why the original branch hung. Today I set about to cleanup the mess I made of #3 which happened because I deleted my local branch (since I forgot that that PR was my replacement of this one) and by doing so closed it. After @plicease removed the errant tarball that was in these commits and I rebased it against current master it passed. Therefore I have now merged and released it. Sorry it took so long :D