codeception_002

I do love using Grunt Watch for all my development compiling and running automated tests.  One down side when using PhantomJS with codeception however is that you need to manually spawn an instance (typically with phantomjs --webdriver=4444) before you can run your codeception tests in another window.  This doesn't suit me and thus I've discovered a nice little package for grunt called grunt-run.

Basically when I want to run my tests, I hit grunt test - which spawns an instance of phantomjs, runs codeception, and then terminates phantomjs once codeception is finished.  Here's my grunt file.

I've made a little repo for you to play with as a starting point (or if you want to see each step involved through tags. Available at https://github.com/darrennolan/codecept-phantomjs

(more…)