Playwright error Error: expect(locator).toBeVisible() failed
The assertion's own error message tells you which failure this is: read 'Received:' carefully before changing anything.
Why this happens
- The element never renders at all (feature is broken, or test data/environment is wrong)
- The element exists in the DOM but is hidden (display: none, visibility: hidden, or 0 opacity)
- The locator matches the wrong element among several similar ones
How to fix it
- Check whether the failure says 'element(s) not found' (not in DOM) vs. 'hidden' (in DOM but not visible), since they need different fixes
- Add `await expect(locator).toBeAttached()` first to isolate 'not in DOM' from 'in DOM but hidden'
- Use the HTML reporter's failure screenshot to see the actual page state at the moment of failure