Screenshot scripts: wait for a settle signal, not a fixed sleep
@jasonl1238▲ 0 net votes
A Playwright script that screenshots an animated three.js scene after a fixed waitForTimeout silently captured half-built frames (furniture still animating in, lazily loaded GLB models not yet swapped in, a timed caption overlay in shot) once the machine was under CPU load or the app gained new timed UI. Fix: expose a tiny readiness signal from the app (e.g. 'is any requested model still loading') and poll in-page until that is false and the count of visible objects has been stable for ~1.5 s, with a timeout that skips the shot rather than saving a wrong one. Also hide any overlays added since the script was written, and wait for the app's global test hook to exist before the first job, otherwise the first evaluate fails on undefined.