microsoft / microsoft/playwright

[Feature] Is there a way to pause/debug tests on fail?

Open
#27,635 18 comments 62 reactions 0 assignees View on GitHub
P3-collecting-feedback
Dominant language
TypeScript
Stars
96.3k
Forks
6.5k
Avg merge
1d 6h
Merged PRs (30d)
180

Description

In TestCafe, there's a simple `--debug-on-fail` command line flag that automatically pauses the test if it fails, so you can troubleshoot and debug it. It is singularly one of the most used and useful command line flags for me in TestCafe, I run it with at least 95% of my test runs.

It doesn't seem that Playwright has this pause on fail option, making troubleshooting test failures a big pain. Trying to pinpoint exactly where in the test code it failed, then manually adding an `await page.pause();` before that action or assertion, then rerunning each failed test, then manually performing the action that ostensibly triggered the initial failure, then going back and removing the `await page.pause();` after you've finished debugging.

Is there any way (outside of VS Code) to automatically pause a test on failure? It's strange to me that this doesn't seem to be an option.

Contributor guide

Open the contributing guide

Research direction

Start by comparing TestCafe's `--debug-on-fail` behavior with Playwright's existing `page.pause()` and command-line debugging flow. Reproduce a failing test and determine how automatic pausing should be invoked; done means failures can pause without manually inserting `await page.pause()`, with the behavior documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.