I am using Puppeteer to do visual regression testing (specifically I am using the jest-image-snapshot library for this). Unfortunately, when I use machines with different screen characteristics, the screenshots are slightly different and the tests fail. For example, I have a test where the screenshot was originally taken on a non-retina Mac display, but when the test runs on a Mac with a retina display there are minor differences in the screenshot that make the test fail.
- Is it possible to take screenshots with Puppeteer that are independent of the display used?
- I tried to force a non-retina screenshot on a retina display by calling
setViewport
, but that didn't help:page.setViewport({width: 800, height: 600, deviceScaleFactor: 1});
- Are there any other screenshoting tools/techniques that address this issue?