A fully-automated testing rig #1
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.
- Part 2: Setting up for a large project
- Part 3: Using other scripts, datasources and directories
- Part 4: When TrueType doesn't fix everything
- Part 5: Fun with viewports and THEN some
- Part 6: Manually fail a test, but continue script execution
- Part 7: When this.mouse.click doesn't work
- Part 8: Debugging a CasperJS project