
Why Your Playwright Tests Pass But Images Are Broken
Your tests are green. CI passed. You deploy. And then someone Slacks you: "Half the images on the product page are broken." You check the test run. Everything passed. No failures. No warnings. The suite did exactly what it was told to do. That's the gap nobody talks about. Playwright doesn't catch what it's never asked to check Broken images don't show up as passing tests . They show up as passing tests. Playwright isn't wrong here. It checked what your assertions told it to check. Nothing more. Four things cause this: 1. A 404 The CDN path changed, a file got deleted, the src attribute points at something that no longer exists. The browser renders a broken icon. The test moves on. 2. An invisible image CSS hides the element. The container collapses to zero height. Something overlays it. isVisible() comes back true because the element is technically in the DOM. Users see nothing. 3. A 1x1 placeholder The image loads but it's a pixel-sized fallback from a bad API response or a failed up
Continue reading on Dev.to Webdev
Opens in a new tab



