Very similar to Testing Library example, it shows that you are probably familiar with Playwright !
Let's code a counter with the help of Playwright VSCode extension. We'll see Locators, web-first assertions, step by step debugging, and screenshots !
CLI watch mode is not documented. If you want it to be publicly available, please upvote this GitHub issue
It's almost fast enough for TDD !
PWTEST_WATCH=1 npm run test
set PWTEST_WATCH=1
npm run test
$env:PWTEST_WATCH=1
npm run test
Alternatives are the VSCode extension and UI mode.