chore: make puppeteer screenshot wait (#43978)

* chore: make puppeteer screenshot wait

* chore: use waitForSelector

* chore: update
This commit is contained in:
MadCcc 2023-08-03 10:39:16 +08:00 committed by GitHub
parent 8f2de9a9d7
commit 7829ff9f2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,9 @@ export default function imageTest(component: React.ReactElement) {
</div>
))}
</App>
<div id="end-of-screen" style={{ height: 0, margin: 0, padding: 0, overflow: 'hidden' }}>
end of screen
</div>
</StyleProvider>
);
@ -72,6 +75,8 @@ export default function imageTest(component: React.ReactElement) {
styleStr,
);
await page.waitForSelector('#end-of-screen');
const image = await page.screenshot({
fullPage: true,
});