This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
You probably know that you can spin up Playwright's UI mode with npx playwright test --ui
and rerun your tests with the watch mode.
It's a handy feature when you're developing your tests while still being in the try-and-error phase. Especially when I'm working on quick tests, I miss the quick feedback loop of CLI watch mode, which doesn't seem to be implemented. Or is it?
I just discovered a CLI watch mode topic GitHub issue.
Turns out, people are asking for a CLI watch mode, and a first version is implemented, and you can use it by setting an environment variable.
PWTEST_WATCH=1 npx playwright test
I played around with it for a minute and will definitely use the hack out of it.
But be aware: the current implementation is experimental, and it's there to gather feedback from the community. The feature might break or even disappear, but if you have feedback or want to give a thumbs-up, head over to the GitHub issue.
I'd love to see this becoming a real --watch
mode, though.
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

Stefan Judis | Sciencx (2025-01-26T23:00:00+00:00) Playwright has an experimental CLI watch mode (#tilPost). Retrieved from https://www.scien.cx/2025/01/26/playwright-has-an-experimental-cli-watch-mode-tilpost/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.