Files
openlayers/test_rendering
Andreas Hocevar 7e940e618e Introduce new overlaps option for Vector and VectorTile sources
Instead of deciding whether to batch fills and strokes by looking at the
opacity of the style, we now rely on user input.
2016-08-23 12:05:03 +02:00
..
2016-03-31 19:25:42 +13:00
2015-04-26 20:37:58 +02:00
2016-08-03 09:25:27 +02:00

Rendering tests

This directory contains rendering tests which compare a rendered map with a reference image using resemble.js.

Similar to the unit tests, there are two ways to run the tests: directly in the browser or using SlimerJS from the command-line.

To run the tests in the browser, make sure the development server is running (make serve) and open the URL http://localhost:3000/test_rendering/index.html.

From the command-line the tests can be run with the build target make test-rendering.

Adding new tests

When creating a new test case, a reference image has to be created. By appending ?generate to the URL, a canvas with the rendered map will be shown on the page when calling expectResemble. Then the reference image can simply be created with a right-click and "Save image as".

It is recommended to only run a single test case when generating the reference image.

Image difference

When a test fails, an image showing the difference between the reference image and the rendered map can be displayed by appending ?showdiff to the URL.