gosling.js
gosling.js copied to clipboard
test(core): add visual regression testing
Fix #958 Toward #
Adds a yarn screenshot
command. This command will use dist/gosling.js
in a headless browser (using puppeteer) and take a screenshot of the visualization that is included in the editor. It will save these screenshots in img/visual-regression/new-screenshots
. If there is a difference compared to the screenshots in img/visual-regression/screenshots
it will show the differences in an image in img/visual-regression/diffs
.
Interestingly, the Gosling genomic axis is non-deterministic for many specs. Parts of the axis will look different between renders. This makes automated visual regression testing unsuitable. I think this best used as a check when testing locally to make sure that many visualizations are not impacted.
Checklist
- [ ] Ensure the PR works with all demos on the online editor
- [ ] Unit tests added or updated
- [ ] Examples added or updated
- [x] Documentation updated (e.g., added API functions)
- [ ] Screenshots for visual changes (e.g., new encoding support or UI change on Editor)