jfgreffier / playwright-component-demos

Playwright Component Testing demos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playwright Component Testing demos

Official documentation

Demo 1 - First Playwright component test

Demo1.spec.tsx

Demo1-annotated.spec.tsx

Very similar to Testing Library example, it shows that you are probably familiar with Playwright !

Demo 2 - Live-coding

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 !

Counter.spec.tsx

Watch mode

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.

Demo 3 - Trace viewer

https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/data/cb0fa77ebd9487a5c899f3ae65a7ffdbac681182.zip

About

Playwright Component Testing demos

License:MIT License


Languages

Language:TypeScript 59.1%Language:CSS 26.5%Language:HTML 7.3%Language:JavaScript 7.0%