Skip to content

chore: add visual tests to reduce regressions#898

Open
domoritz wants to merge 20 commits intomainfrom
dom/visual-tests
Open

chore: add visual tests to reduce regressions#898
domoritz wants to merge 20 commits intomainfrom
dom/visual-tests

Conversation

@domoritz
Copy link
Copy Markdown
Member

@domoritz domoritz commented Sep 27, 2025

Uses playwright to render the examples and compares them to stored snapshots. You can update the examples locally with docker. The GitHub Action also uploads the diffs so you don't need to use docker.

I'm not a fan of using a timeout to wait for renders. Is there a reliable way to wait for render to be done?

@domoritz domoritz changed the title chore: add visual tests chore: add visual tests to reduce regressions Sep 27, 2025
@domoritz domoritz marked this pull request as ready for review September 27, 2025 20:16
@domoritz domoritz requested a review from jheer as a code owner September 27, 2025 20:16
Copy link
Copy Markdown
Member

@jheer jheer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level, it would be great to have tests of rendered specs so we can be more robust and against breakage, especially with new collaborators and/or AI assisted code. I don't like inflated test run times but can live with that if not egregious.

One concern is generating the snapshots. If you have to install Docker etc its a bigger lift that adds overhead to development setup. Of course, different browsers / OSes render differently so if you go through a browser you don't have a choice. At minimum I think we want to have scripts (not just README instructions) in place to minimize effort if we go this direction.

An alternative would be to do server-side rendering via jsdom or similar. That has its own drawbacks but tends to be fast and portable.

@domoritz domoritz requested a review from jheer April 4, 2026 03:36
@domoritz domoritz mentioned this pull request Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants