Playwright · Senior · Question 34 of 77
How can a fixture fail tests that print console errors?
- 1Errors printed in the browser console always fail Playwright tests
- 2An auto fixture listens to
console/pageerrorand checks at the end - 3Set
failOnConsoleError: truein theuseblock ofplaywright.config
Show the answer
Correct answer: An auto fixture listens to console/pageerror and checks at the end
Explanation
Collecting errors and asserting after use() catches crashes that don't break the visible UI.