I have a web application that uses the d3 library for some complex SVG based visualizations.

I have automated tests for my server side code and JavaScript models (I use an MVC like architecture in my JavaScript). These are run on a Jenkins CI server on every commit. Now I need to work out how to test my views.

How do others tackle this problem and what tools do you use?

Some thoughts I've had ...

  • Serialize the SVG generated to a file and compare to a baseline
  • Automatically capture a browser image and do an image diff
  • Something else?

Thanks!

Edit
Report