visual-testing-snapshots
Skill390 starsChanged 35 days agoMITView on GitHub
Run IX visual-testing snapshot checks or snapshot updates inside the Playwright Docker image. Use for updating or verifying visual regression snapshots with the visual-testing package, especially when a specific .e2e.ts test file should be run with or without -u.
- Installs packages
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- changeset-decisionSkill
- create-changesetSkill
- sddSkill
- ix-installationSkill
- ixSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 6 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Update IX visual regression snapshots for one or more testing/visual-testing//*.e2e.ts files.
- Distinctive: line 21
Run visual-testing snapshot checks and updates only inside a Playwright Docker image.
- Very specific: line 22
Use the Docker image that matches the currently used @playwright/test or playwright version from pnpm-workspace.yaml.
- Distinctive: line 25
Do not run a build inside Docker.
- Very specific: line 26
Do not run pnpm run test.setup inside the Playwright Docker image unless a test explicitly fails because the browser installation is …
- Very specific: line 37
Make sure the test file exists under testing/visual-testing/tests/.
- Very specific: line 38
If the requested action is an update, run the test inside Docker with -u.
- Very specific: line 39
If the requested action is a verification run, run the same command without -u.
- Very specific: line 40
Keep the build outside Docker.
- Very specific: line 41
After the run, inspect the changed files under testing/visual-testing/__screenshots__/ and report the updated snapshots or test failure.
- Distinctive: line 65
If Docker is not available, stop and report that visual-testing snapshot updates require Docker.
- Very specific: line 66
If pnpm is missing inside the container, keep npm i -g pnpm in the Docker pipeline instead of using a host-installed package manager.
- Distinctive: line 67
If the test fails because built IX output is missing, stop and ask for or run the needed build outside Docker, then re-run only the …
- Distinctive: line 68
If snapshots change unexpectedly outside the requested test area, inspect the diff before reporting success.
- Distinctive: line 72
When using this skill, report:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Visual Testing Snapshots
When to Use
- Update IX visual regression snapshots for one or more
testing/visual-testing/**/*.e2e.tsfiles. - Re-run a visual regression test inside Docker to verify snapshot changes.
- A PR changes component UI, styling, theme output, layout, density, screenshots, or visual state and requires snapshot updates.
- A visual regression failure needs to be reproduced in the same Linux Playwright environment used by CI.
Required Constraints
- Run visual-testing snapshot checks and updates only inside a Playwright Docker image.
- Use the Docker image that matches the currently used
@playwright/testorplaywrightversion frompnpm-workspace.yaml. - For the current repository configuration, use
mcr.microsoft.com/playwright:v1.64.1-noble. - Install
pnpminside the Docker command or shell withnpm i -g pnpm. - Do not run a build inside Docker. If built package output is required, build outside Docker before starting the snapshot update flow.
- Do not run
pnpm run test.setupinside the Playwright Docker image unless a test explicitly fails because the browser installation is missing.
Inputs To Gather
- The visual test file to run, preferably a path under
testing/visual-testing/tests/, for exampletesting/visual-testing/tests/button/button.e2e.ts. - Whether the user wants to update snapshots (
-u) or only verify the current snapshots. - Whether the repository has already been built outside Docker when the visual test depends on built package output.
Procedure
- Confirm the current Playwright version from
pnpm-workspace.yamlbefore choosing the Docker image. Use the matchingmcr.microsoft.com/playwright:v<version>-nobleimage. - Make sure the test file exists under
testing/visual-testing/tests/. - If the requested action is an update, run the test inside Docker with
-u. - If the requested action is a verification run, run the same command without
-u. - Keep the build outside Docker. Do not add
pnpm build,pnpm run build, or Turbo build commands to the Docker command. - After the run, inspect the changed files under
testing/visual-testing/__screenshots__/and report the updated snapshots or test failure.
Commands
From the repository root, update snapshots for a specific test:
docker run --rm -v "$(pwd):/work" -w /work mcr.microsoft.com/playwright:v1.64.1-noble /bin/bash -lc 'npm i -g pnpm && pnpm --filter visual-testing visual-regression mytest.e2e.ts -u'From the repository root, verify a specific test without updating snapshots:
docker run --rm -v "$(pwd):/work" -w /work mcr.microsoft.com/playwright:v1.64.1-noble /bin/bash -lc 'npm i -g pnpm && pnpm --filter visual-testing visual-regression mytest.e2e.ts'Replace mytest.e2e.ts with the requested test file name or path, for example:
docker run --rm -v "$(pwd):/work" -w /work mcr.microsoft.com/playwright:v1.64.1-noble /bin/bash -lc 'npm i -g pnpm && pnpm --filter visual-testing visual-regression testing/visual-testing/tests/button/button.e2e.ts -u'Failure Handling
- If Docker is not available, stop and report that visual-testing snapshot updates require Docker.
- If
pnpmis missing inside the container, keepnpm i -g pnpmin the Docker pipeline instead of using a host-installed package manager. - If the test fails because built IX output is missing, stop and ask for or run the needed build outside Docker, then re-run only the visual-testing command inside Docker.
- If snapshots change unexpectedly outside the requested test area, inspect the diff before reporting success.
Output Format
When using this skill, report:
- Docker image used.
- Command run.
- Snapshot update status: updated, unchanged, or failed.
- Changed snapshot files, if any.
- Any follow-up needed, such as running the build outside Docker before retrying.
Example Prompts
Use the visual-testing-snapshots skill to update button.e2e.ts snapshots.Run the visual-testing snapshot check for testing/visual-testing/tests/menu/menu.e2e.ts without updating.Update the visual regression snapshots for mytest.e2e.ts in Docker.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

