Playwright has an experimental CLI watch mode
- Published at
- Updated at
- Reading time
- 1min
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.
Join 5.6k readers and learn something new every week with Web Weekly.