You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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
: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
The text was updated successfully, but these errors were encountered: