Attach Screenshots to Your Playwright Test Reports
Today I want to show you how you can attach your screenshots directly to Playwright's test reports. Imagine you have a simple Playwright test that navigates to Checkly. You take a screenshot and store it in screenshots/home.png. Then, you click a link in the main navigation, expect a specific heading to be visible, and take another screenshot. When you run this test using npx playwright test, the test passes, and you find the screenshots in the /screenshots directory.