-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Question] - Screenshot on lazyload sites #1872
Comments
I think your best bet here is to have some code in your app that sets a state variable, and then use waitForFunction to check that variable in your test code. App code // check if images are loaded, then run this
window.allImagesLoaded = true; Test code await page.waitForFunction(() => {
return window.allImagesLoaded === true;
});
await page.screenshot({...}); |
This advice looks great. Closing for now, please feel free to reopn. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have been trying to make a screenshot for a link that has lazyload images.
This is what I have so far:
I want to get rid of the hardcoded times from code and make the screenshot fire at the moment all resources are loaded. Any ideeas?
Thank you!
The text was updated successfully, but these errors were encountered: