This thread is trying to answer question "Is there any way to reduce the size of the screenshots when using toHaveScreenshot?"
You can try this out, too: https://stackoverflow.com/a/75508670 And then use for instance jpg: https://playwright.dev/docs/api/class-page#page-screenshot-option-type, https://playwright.dev/docs/api/class-page#page-screenshot-option-path And use sufficiently low quality for the jpg: https://playwright.dev/docs/api/class-page#page-screenshot-option-quality
You can use https://argos-ci.com/ to upload screenshots and avoid commit it in your repository. So you don't care about the size of screenshots and it is easier to maintain.
Here is our Playwright presentation page: https://argos-ci.com/playwright
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].