logoalt Hacker News

kkarpkkarptoday at 9:32 AM1 replyview on HN

> you have to first generate a screenshot by running your suite with --update-snapshots.

How is it executed? Is it something build in into the Playwright, or there is missing part of the code presented, responsible for executing it?


Replies

beingflotoday at 10:41 AM

Ah forgot to mention it in the post. This comes built in by Playwright. Normally, you invoke the test suite by running `npx playwright test`. This fails your test if a screenshot is missing or if it differs. By running `npx playwright test --update-snapshots` you tell Playwright to just overwrite the snapshots and not fail tests.