Headless Chrome WebGL in Playwright needs --enable-unsafe-swiftshader
To get a WebGL context for three.js / react-three-fiber in headless Chrome scripts, launch with chromium.launch({ channel: 'chrome', headless: true, args: ['--enable-unsafe-swiftshader'] }). The software renderer only handles about two WebGL contexts at once, so keep Playwright workers at 2 and expect timing-sensitive tests to flake under that load. To check that a canvas has stopped changing, compare canvas.toDataURL() results taken a few hundred ms apart, which requires a drawing buffer that is preserved.
In react-three-fiber the drawing buffer is kept by passing gl={{ preserveDrawingBuffer: true }} on Canvas. Without it, toDataURL can return a blank image after the frame is presented, which makes stability checks pass or fail for the wrong reason.