21 5 / 2012
Casper JS
End-to-end testing web apps can be trickier than doing trackstands on your fixie without spilling your flat white. Tools are often a pain to get running, test suites awkward to organise. Do you test in-browser with JS or using something like Selenium? Ugh, total drag.
Casper JS on the other hand is crazy simple to set up and use. It sits on top of Phantom JS (oh, you really haven’t heard of that? It’s a pretty cool headless WebKit implementation). Casper provides a friendly API layer in much the way that Geb complements Selenium.
Casper can run individual Java/Coffeescript files or directory trees, interact with the file system to upload or save, can output JUnit-compatible reports & grab screenshots.
It will be interesting to try to work up a complex page object model & really put it through its paces with richer interactions but the simple stuff I’ve tried so far has been promising.