Quick Reference
| Step | Command / Action |
|---|---|
| Add assertion | await expect(page).toHaveScreenshot() |
| Run tests | npx playwright test |
| Upload with images | npx tdpw upload ./playwright-report --upload-images |
| Update baselines | npx playwright test --update-snapshots |
Prerequisites
- Playwright Test and at least one test using
toHaveScreenshot()(Playwright Docs) - A Playwright report directory to upload (example:
./playwright-report) - A TestDino token available as an environment variable or CI secret
- Upload is configured to include images
Quick Start Steps
1
Add a visual assertion
Start with a single
toHaveScreenshot() assertion.TestDino can only show visual diffs for tests that generate screenshot comparisons.
2
Run your tests
Run Playwright as usual.Playwright must generate the screenshots and snapshot comparison output for the run.
3
Upload the report with images
Upload screenshots so TestDino can render the Visual Comparison panel.
- Upload images
- Upload full JSON and artifacts
4
Configure CI upload
Example GitHub Actions workflow.
Examples
View a failed visual test
- Open the failing run in TestDino
- Open the failing test case
- Use the Visual Comparison panel to switch between:
- Diff
- Actual
- Expected
- The test uses
toHaveScreenshot() - Your upload command includes
--upload-imagesor--upload-full-json