Playwright has an experimental CLI watch mode (#tilPost)

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.

[Feature] “Headless” CLI Watch Mode
RichiCoder1 opened it Mar 24 2023

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

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.

[Feature] "Headless" CLI Watch Mode
RichiCoder1 opened it Mar 24 2023

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.

Demo session showing Playwright's experimental CLI watch mode.

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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Playwright has an experimental CLI watch mode (#tilPost)." Stefan Judis | Sciencx - Sunday January 26, 2025, https://www.scien.cx/2025/01/26/playwright-has-an-experimental-cli-watch-mode-tilpost/
HARVARD
Stefan Judis | Sciencx Sunday January 26, 2025 » Playwright has an experimental CLI watch mode (#tilPost)., viewed ,<https://www.scien.cx/2025/01/26/playwright-has-an-experimental-cli-watch-mode-tilpost/>
VANCOUVER
Stefan Judis | Sciencx - » Playwright has an experimental CLI watch mode (#tilPost). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/01/26/playwright-has-an-experimental-cli-watch-mode-tilpost/
CHICAGO
" » Playwright has an experimental CLI watch mode (#tilPost)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2025/01/26/playwright-has-an-experimental-cli-watch-mode-tilpost/
IEEE
" » Playwright has an experimental CLI watch mode (#tilPost)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2025/01/26/playwright-has-an-experimental-cli-watch-mode-tilpost/. [Accessed: ]
rf:citation
» Playwright has an experimental CLI watch mode (#tilPost) | Stefan Judis | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.