Skip to main content

A fully-automated testing rig #1

An article from ComputerMinds - Building with Drupal in the UK since 2005
1st Jul 2014

Nathan Page

Developer
Hey, you seem to look at this article a lot! Why not Bookmark this article so you can find it easily in the future?

A quick introduction

A few months ago I started my first project with CasperJS and PhantomCSS, and what an interesting experience it has been working through that to now our second, larger, automated testing setup. Being young projects, there are some fun quirks and niggles in CasperJS and PhantomCSS that I wish the world could have warned me about.

I'm working on an automated testing rig that will politely inform our team members when they inadvertently break certain designs or content functionality. The design side involves using CasperJS to go to a set of test pages, then having PhantomCSS take screenshots of specific content areas. In the -post script, PhantomCSS then compares all the screenshots against a set of 'baseline' screenshots. When the magic is complete, we have a lovely set of passes and fails passed through to Jenkins.

We now have it all automatically running, and are assessing how well it's working for us.

So here goes, a mini-series on CasperJS and PhantomCSS (mostly CasperJS) to both highlight some awesome bits and to offer some tips on working around some of the fiddly bits.

Hi, thanks for reading

ComputerMinds are the UK’s Drupal specialists with offices in Bristol and Coventry. We offer a range of Drupal services including Consultancy, Development, Training and Support. Whatever your Drupal problem, we can help.