gosling.js icon indicating copy to clipboard operation
gosling.js copied to clipboard

test(core): add visual regression testing

Open etowahadams opened this issue 1 year ago • 4 comments

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/screenshotsit 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)

etowahadams avatar Aug 17 '23 16:08 etowahadams