Skip to content

Add Playwright text snapshot check for i18n - #6079

Draft
pmonfort wants to merge 1 commit into
otwcode:masterfrom
pmonfort:pm_playwright
Draft

pmonfort wants to merge 1 commit into
otwcode:masterfrom
pmonfort:pm_playwright

Conversation

@pmonfort

@pmonfort pmonfort commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

XXXXXX

Purpose

Proof of concept from the Slack discussion about checking that i18n PRs don't change any rendered text. Draft so we can discuss over real code.

It adds Playwright using the aria snapshots feature, which compares a page's visible text and elements without using screenshots. The baseline is a YAML file committed to the repo. When a PR changes any rendered text or element the build fails, and if the change is intentional the contributor runs a command to regenerate the YAML. It also catches the forgotten _html case, since the escaped markup shows up as literal text.

The proof of concept covers one test for the new work form and an informational CI job that boots the app with the db:otwseed fixtures, so baselines are deterministic and match CI. The whole job takes about 2 minutes, most of it booting the app. One consideration is that this adds a Node toolchain to the CI. More details in playwright/README.md

Testing Instructions

No user-facing changes. To try it locally, follow playwright/README.md: start a seeded test server and run npm run test:playwright against it. To see the failure mode, change any visible string in the work form views and run it again.

References

Slack discussion in #ao3-coders about reviewing i18n PRs.

Credit

Pablo Monfort (he/him)

@pmonfort
pmonfort force-pushed the pm_playwright branch 2 times, most recently from 6fa8979 to 56e84dd Compare October 27, 2026 02:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant