Large end-to-end test suites are great for coverage, but they can quickly become expensive when something fundamental breaks. Imagine running hundreds of Playwright tests in CI only to discover that the application was unstable from the very beginning.
This is where Playwright’s maxFailures option becomes useful.
With maxFailures, you can tell Playwright to stop the test run after a specific number of failures. Instead of waiting for the entire suite to complete, the execution fails fast and gives the team quicker feedback.

In this example, Playwright stops the run after 1 test failure. This is especially useful in CI/CD pipelines, where continuing a clearly broken test run may waste time, infrastructure resources, and developer attention.

You can also override this value directly from the command line:npx playwright test --max-failures=5
Or stop after the first failure using the shortcut:
npx playwright test -xThis is how the execution status looks in the CLI when using maximum 1 allowed failure. A test failed then the following tests were automatically interrupted.

Why use maxFailures?
maxFailures helps you:
- Save execution time
- Reduce CI/CD resource consumption
- Get faster feedback from unstable builds
Small configuration. Big impact.