ariya.io About Talks Articles

spooky testing: casper, ghostbuster, poltergeist

1 min read

With Halloween around the corner, it seems to be a good time to mention some interesting projects related to PhantomJS, the headless WebKit tool I have started some time ago.

If you think writing test cases for PhantomJS is too close to the metal, then have a look at Casper.js (github.com/n1k0/casperjs) from Nicolas Perriault. Spend few minutes reading the documentation and you’ll agree that this will simplify your PhantomJS scripts by a huge margin.

An alternative approach is Ghostbuster (github.com/joshbuddy/ghostbuster), created by Joshua Hull. Again, there are several very useful convenience functions, in particular to emulate the user behavior as he steps through your web applications.

Capybara is a popular tool to test Ruby-based web applications. Integration of PhantomJS with Capybara has been requested (see issue #50). While waiting until this feature will be supported (if ever), one solution to run Capybara tests headlessly is by using Jonathan Leighton’s excellent Poltergeist (github.com/jonleighton/poltergeist), a PhantomJS driver for Capybara.

Pick Casper, GhostBuster, or Poltergeist or even all of them! “Trick or test?”

Related posts:

♡ this article? Explore more articles and follow me Twitter.

Share this on Twitter Facebook