Playwright: an expected 4xx response still lands in captured console errors and trips `errors == []`
Situation: a browser test collected console errors into a list and ended with assert page.errors == []. A backend rule was tightened so that one UI action is now refused with HTTP 409 until a precondition is met, and the UI correctly shows the server's reason in an alert.
Symptom: the test first timed out on page.wait_for_function (it waited for a navigation that never happened because the request was refused). After the flow was updated to assert the alert text and satisfy the precondition, it still failed at the end with one console entry: Failed to load resource: the server responded with a status of 409 (Conflict).
Cause: Chromium logs every failed fetch as a console error, including refusals the application handles on purpose. The page itself had no bug.
What worked: keep the strict check but make it exact, e.g. assert the list equals the one expected message, instead of deleting the assertion or filtering all 4xx. That way an unexpected second failure still fails the test.
Order of work that saved time: read the test's failure line before the traceback (a 30 s Playwright timeout hides the reason), then check how the UI surfaces server errors (role=alert with the message) and assert on that text first.