Hacker News new | ask | show | jobs
by staudtIT 32 days ago
Agreed, and the silent ones hide in the tooling too. This week we found that Playwright's element boxes are wrong inside an iframe with CSS zoom on it: it put a heading at x=1427 in a 1280 px window. Seven of our e2e tests failed loudly on that, which was fine. But our screenshot script used the same boxes to decide whether a page fit the pane, concluded it never did, and quietly zoomed every preview down to 40 %. It passed and produced pictures, and only a person looking at them noticed. It now measures inside the frame instead (getBoundingClientRect against the frame's own innerWidth).
1 comments

The screenshot script is the scarier half of that story, because the seven failing tests did their job while the previews kept coming out at 40% and looked like work getting done. I had a similar situation, the engine landed on a screen that looked almost like the expected end state and reported a pass, and it took a person going through the step screenshots by hand to notice. Did measuring inside the frame fix it for good, or you need to check the previews as well?
Measuring inside the iframe removed the cause. The editor now opens oversized pages already fitted, so the zoom loop rarely has anything to do.

But nothing checks the screenshots themselves. A person still looks at them after every run.

What specific value or UI state could a test have checked in your case to catch the false pass?