waitForVisualStability
waitForVisualStability(
page,timeoutMs?):Promise<void>
Defined in: fixture.ts:195
Wait for the page to be visually stable enough to screenshot.
Playwright already handles the heavy lifting — actionability waits gate every click/fill, web-first assertions auto-retry, and CSS animations/transitions are disabled globally by the injected overlay stylesheet. The only things left that can still cause a “wobbly” screenshot are:
- Web fonts not yet loaded (text reflows mid-shot).
- The browser not having flushed the latest layout to a frame.
So: wait (briefly) for document.fonts.ready, then two rAFs to ensure the
compositor has painted. Everything else (networkidle, MutationObserver idle
loops, image-load polling) was redundant and slow.
Parameters
Section titled “Parameters”Page
timeoutMs?
Section titled “timeoutMs?”number = 500
Returns
Section titled “Returns”Promise<void>