Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Allow to configure Puppeteer in the Percy plugin. #373

Open
4 tasks done
gr33nwhal3 opened this issue Nov 25, 2022 · 0 comments
Open
4 tasks done

Enhancement: Allow to configure Puppeteer in the Percy plugin. #373

gr33nwhal3 opened this issue Nov 25, 2022 · 0 comments
Labels
enhancement: to triage New feature of request pending review by team member

Comments

@gr33nwhal3
Copy link

gr33nwhal3 commented Nov 25, 2022

Clear and concise description of the problem

Percy plugin uses Puppeteer to navigate and take screenshots. In some cases, the screenshots taken by Percy are empty/blank because the page did not load fast enough before the screenshot was taken.

Suggested solution

Configuring Puppeteer would allow for example to use the option {"waitUntil": "networkidle0"} on page goto function :

page.goto(url, {"waitUntil": "networkidle0"})

and allows to wait for the stabilization of the page before making the screenshot.

Using this option solves my screenshot problems with Percy.

I tested this small feature allowing to use the Puepetter options in the percy plugin by fully exposing the Pueppeter configuration like what is done for Percy: https://github.com/gr33nwhal3/histoire/tree/feat/add-puppeteer-options-in-percy-plugin

Another possibility would be to "hide" the use of Pueppeter by creating an option to the Percy plugin like waitForIdle :

HstPercy({
      waitForIdle: true
    }),

internally would add the option to Puppeeter : page.goto(url, {"waitUntil": "networkidle0"})

Alternative

No response

Additional context

With the Vue3 plugin, without this configuration, valid screenshots are quite random and represent about 10% of the total. None of the tested components are really complex or make network calls that could explain this problem.

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement: to triage New feature of request pending review by team member
Projects
None yet
Development

No branches or pull requests

1 participant