Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated testing for rendered visualization differences #958

Open
etowahadams opened this issue Aug 5, 2023 · 1 comment · May be fixed by #962
Open

Automated testing for rendered visualization differences #958

etowahadams opened this issue Aug 5, 2023 · 1 comment · May be fixed by #962
Assignees
Labels
enhancement New feature or request

Comments

@etowahadams
Copy link
Contributor

Background:
Sometimes, Gosling code changes will break a visualization, but will not cause any tests to fail. For example, #938 #957 were patches that had to be made after a release because automatic tests did not alert us of anything wrong.

Potential solution:
@sehilyi: To avoid future instances of this, we could set up tests that compare the actual images of visualizations that the previous and updated displayed. It looks like puppeteer, which is a library that helps to capture screenshots, has the ability to add <script> using a local file (https://pptr.dev/api/puppeteer.page.addscripttag), so I imagine that we can bundle the gosling.js and then use in puppeteer to create Gosling image files based on a updated Gosling.js.

An example of puppeteer with Gosling: https://github.com/hms-dbmi/chromoscope/blob/master/src/script/gosling-screenshot.js

@etowahadams etowahadams added the enhancement New feature or request label Aug 5, 2023
@etowahadams etowahadams self-assigned this Aug 17, 2023
@etowahadams etowahadams linked a pull request Aug 17, 2023 that will close this issue
5 tasks
@etowahadams
Copy link
Contributor Author

Status update:
Since #988 we are now using Playwright (instead of puppeteer, as I tried in my initial attempt). Playwright has some features which makes it easier to record user interaction features. Going forward, we will use Playwright for visual regression testing.

Ideally, we want these visual regression tests to run in CI/CD. One challenge is that the the screenshots taken in in the CI environment are different from those taken in my local environment (rendering is slightly different so screenshots don't match between CI and local). This means that either you don't be able to run visual regression testing locally, or we'll have to have two copies of the screenshots: one from local env and one from the test runner env. I think we'll probably opt for the former.

Here is the Playwright guide for running tests in CI: https://playwright.dev/docs/ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant