BackstopJS icon indicating copy to clipboard operation
BackstopJS copied to clipboard

add captureBeyondViewport flag for Puppeteer

Open saitho opened this issue 4 years ago • 5 comments

Since v5.3.7 Puppeteer does not capture beyond viewport anymore, which could cause some issues for people relying on it. A new flag captureBeyondViewport for toggling that setting is introduced in BackstopJS configuration as discussed in #1344.

saitho avatar Nov 12 '21 13:11 saitho

@garris I was wondering, is there a documentation on available engineOptions? I wanted to add the new flag but didn't find any documentation on that. :(

saitho avatar Nov 12 '21 13:11 saitho

Hi @saitho -- the engineOptions props are pretty much passed directly into puppeteer...

https://github.com/garris/BackstopJS/blob/9fa768b3444cee66e427dd68dab0cb6dffe2dda1/core/util/runPuppet.js#L61

image

For more information about how this can be used you can look at Puppeteer documentation.

garris avatar Nov 12 '21 20:11 garris

@saitho Does this new config option mean that we do not need this hack anymore?

https://github.com/garris/BackstopJS/pull/1374/commits/e3a80e207088316aa03fcaf70e9322b51a0ec335

garris avatar Nov 12 '21 20:11 garris

@saitho Does this new config option mean that we do not need this hack anymore?

No, it just allows the user to toggle captureBeyondViewport. I want to use BackstopJS to do regression tests on a styleguide generated via kss-node. I need to set captureBeyondViewport: true for it to work properly, as visibility in a viewport is not important here.

Oh I see, config.engineOptions is used there. I thought config was already the engineOptions. Then my description is wrong. I'll change that. This is not a puppeteer setting, but a new BackstopJS setting.

saitho avatar Nov 12 '21 20:11 saitho

I adjusted the commit message

saitho avatar Nov 16 '21 08:11 saitho