-
-
Notifications
You must be signed in to change notification settings - Fork 835
feat: Allow to pass custom options to Puppeteer screenshot function #3145
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
Feature: Want this? Upvote it!This PR or Issue may be a great consideration for a future idea.This PR or Issue may be a great consideration for a future idea.
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
We expect to be able to pass any options possible to puppeteer screenshot option.
Currently we have only ScreenshotOptions interface.
https://github.com/ionic-team/stencil/blob/main/src/testing/puppeteer/puppeteer-screenshot.ts#L138-L156
function createPuppeteerScreenshopOptions(opts: ScreenshotOptions) {
const puppeteerOpts: puppeteer.ScreenshotOptions = {
type: 'png',
fullPage: opts.fullPage,
omitBackground: opts.omitBackground,
encoding: 'binary',
};
if (opts.clip) {
puppeteerOpts.clip = {
x: opts.clip.x,
y: opts.clip.y,
width: opts.clip.width,
height: opts.clip.height,
};
}
return puppeteerOpts;
}Describe the Use Case
We spot this issue : puppeteer/puppeteer#7251
A resize event happen just before screenshot so it trigger some resize event listener able to redraw the component we try to screenshot.
This resize is unwanted but, with the current stencil testing API, we are not able to avoid it by the solution proposed in the issue: pass the option captureBeyondViewport: false
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Feature: Want this? Upvote it!This PR or Issue may be a great consideration for a future idea.This PR or Issue may be a great consideration for a future idea.