mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 09:48:18 -05:00
Rendering tests
These tests are aimed for more generic rendering tests than the mashup and integration counterparts. These tests do not rely on a Supernova or custom backend solution for producing screenshots. If you want to test a Supernova based viz, you should instead create either a mashup or an integration test.
Tests covered (so far)
Create and run tests
- Create a folder, e.g.
./test/rendering/listbox - Inside that folder, create:
- listbox.spec.js - a test file which orchestrates interactions and when to take a screenshot
- listbox.html - constitutes the "site" that the test file interacts with and creates screenshots from
- listbox.js - (optional) if you don't want to add all JS code inside of the html file
- Run tests from the nebula.js root with
yarn test:rendering - The first time, the test will fail and create an image inside of the
__artifacts__/tempfolder. Drag this file to the__artifacts__/baselinefolder and re-run the test to verify that it passes. Thengit pushthe baseline.
Check the listbox files for details on how to write the code in these files.
Output folders
Screenshots are stored in the following folders:
temp- new screenshots are stored herebaseline- new screenshots are compared to the baseline version of the image, in order to check validity – only update these if a change is expectedregression- new screenshots are saved here when deviating too much (i.e. when they are invalid)diff- the difference between the baseline and the regression image