Is it possible to take device independent screenshots with Puppeteer?

290 Views Asked by At

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.

  1. Is it possible to take screenshots with Puppeteer that are independent of the display used?
  2. 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});
  3. Are there any other screenshoting tools/techniques that address this issue?
0

There are 0 best solutions below