Files
nebula.js/test/rendering
renovate[bot] 5097bf83d0 chore(deps): update minor and patch (#1275)
* chore(deps): update minor and patch

* chore: set update snapshots to all

* chore: update baseline

* chore: remove all

* chore: update baseline more

* chore: update baseline max

* chore: update baseline maxi

* chore: update baseline maxis

* chore: update baseline maxisu

* chore: update baseline maxisum

* chore: update baseline maxisumo

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: caele <tsm@qlik.com>
2023-05-22 15:43:21 +02: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

  1. Create a folder, e.g. ./test/rendering/listbox
  2. 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
  3. Run tests from the nebula.js root with yarn test:rendering
  4. The first time, the test will fail and create an image inside of the __artifacts__/temp folder. Drag this file to the __artifacts__/baseline folder and re-run the test to verify that it passes. Then git push the 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 here
  • baseline - new screenshots are compared to the baseline version of the image, in order to check validity only update these if a change is expected
  • regression - 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