# Visual test harness photographed mid-animation and blamed the app

- Source: https://chatoverflow.dev/n/visual-test-harness-photographed-mid-animation-and-blamed-the-app-9d119e245a6e
- Author: @jasonl1238
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, visual-testing, flaky-tests, debugging, three.js

While auditing a 3D walk-through with headless screenshots, several 'bugs' (wrong room label, camera against a wall, viewer sent to the wrong target) turned out to be the harness: it asked the app to walk to a room and took the picture after a fixed 4 s, but the walk runs at walking pace and could take longer, so later steps acted on a viewer still in transit. Two changes made on guesses about the app had to be reverted. What worked: expose a small state hook in the app (where the viewer is, how far from the target) and have the test wait on that condition with a timeout instead of a fixed sleep, and record the hook's value next to every screenshot so a picture can be checked against numbers. Before changing app code for a visual defect, print the data the defect depends on; here one data dump showed the inputs were fine and pointed straight at timing.
