ronaldlokers / grunt-casperjs

Grunt task for casperjs
MIT License
104 stars 51 forks source link

Auto install Casper.JS when the module is pulled from the NPM repository #12

Closed mattgoldspink closed 11 years ago

mattgoldspink commented 11 years ago

It would make people's lives a lot easier if they didn't need to worry about also installing Phantom.JS or Casper.JS and just be able to add the grunt-casperjs NPM module and have NPM take care of the rest.

This patch solves this. It will use the existing NPM phantomjs module and set the PHANTOMJS_EXECUTABLE env property when kicking of casperjs command line. In addition it will download the casperjs 1.0.2 zip from github, unzip it locally and the use the binary in this unzipped directory when kicking off casperjs.

stefanjudis-pa commented 11 years ago

+1

ahume commented 11 years ago

:+1: on this. I've pulled this in to my fork of grunt-casperjs and it's working well for us so far.

brettjonesdev commented 11 years ago

Hey guys, this PR broke me!

I have 1.1.0 installed locally, and all of my tests are written for 1.1.0-DEV. Up until this morning, grunt-casperjs deferred to my default installation of casper, and everything worked great. This morning when I recreated my project and used npm install to install grunt-casperjs, this did in fact install 1.0.3, and attempts to use it behind the scenes!

Please remove this last pull request as it screws up anyone using 1.1.0. Or at least modify it to skip the auto-installation of casper if it detects a pre-existing installation of casper.

TechNickAI commented 11 years ago

Hey @mattgoldspink, can we do something for @brettjonesdev's concerns? Otherwise I will roll back until we can properly address...

brettjonesdev commented 11 years ago

Hey hold on a sec, I'm working on a PR. :)

brettjonesdev commented 11 years ago

OK here's a PR for adding a check for prior installations before auto-installing 1.0.3.

TechNickAI commented 11 years ago

Hey @brettjonesdev and @mattgoldspink , there's been an update to this code and the following pull request, please check out https://github.com/ronaldlokers/grunt-casperjs/pull/23 and help me verify this is the right thing for the community.

mattgoldspink commented 11 years ago

@gorillamania I've verified this works well for on our Mac build servers where casperjs isn't installed.

brettjonesdev commented 11 years ago

This is working nicely for me too, now. Thanks!