Since testing is one of those practices that many consider boring (unless a major catastrophe happens), you should help people is easing their job while testing.
Today I am going to show the approach that we just kickstarted, at Namshi, in order to help designers and developers testing frontend changes in a more automated, thus easier, way.
Thanks to the NamshiVoyeurBundle, it is really easy to start increasing the efficiency of your testing department, even if coders do not want to write automated tests.
The bundle, that you can use inside a Symfony2 application, is actually very small and can be extrapolated to be integrated in other frameworks (like ZF2 or Cake).
The idea is very simple: you take some screenshots of a website, deploy a new version, take another set of screenshots (at the same URLs) and then compare them, generating an image diff.
After you install the NamshiVoyeurBundle
(via composer),
it is really easy to start taking screenshots;
you just have to configure a few services
and some parameters:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
This configuration basically tells Voyeur that you will be taking screenshots of three URLs:
http://en-ae.namshi.com/
http://en-ae.namshi.com/new-products
http://en-ae.namshi.com/women-shoes
with safari, firefox and google chrome.
To run the Voyeur, use the cli
:
1
|
|
Screenshots will be saved at /Users/you/Downloads/screenshots
.
At this point, after you deployed a new version of the code, run the Voyeur again, and you will be reay to generate the diffs between the screenshots:
1
|
|
Diffs will be generated at /Users/you/Downloads/screenshots/firefox/2013/03/10/1205/diff
.
That’s it: now you can start having a look at what changed and ask your developers to do the same, even on their local machine, before committing any changes.