Quick Reference
Supported Frameworks
NotePlaywright component testing is experimental. The API may change between Playwright versions. See the Playwright component testing docs for full API details.
Setup
1
Initialize component testing
Run the Playwright scaffolding command to create a
playwright/ directory with index.html and index.ts files:- npm
- yarn
- pnpm
2
Install the TestDino reporter
3
Write a component test
Create a test file next to your component. Import
test and expect from the framework-specific package, and use the mount fixture to render the component:- React
- Vue
- Svelte
src/App.spec.tsx
Configure the TestDino Reporter
Add@testdino/playwright to the reporter array in your playwright-ct.config.ts. The configuration is the same as E2E tests:
playwright-ct.config.ts
debug, ciRunId, artifacts, and coverage. See the Node.js CLI reference for the full list.
Run Tests
With@testdino/playwright in the reporter array of playwright-ct.config.ts, set the token and run Playwright against the component test config. Results stream to TestDino during the run.
CI Integration
Component tests run in CI the same way as E2E tests. SetTESTDINO_TOKEN and run Playwright against the component test config. Results stream during the run, so no separate upload step is needed.
.github/workflows/component-tests.yml
Limitations
- Experimental API. The component testing API may change between Playwright releases.
- Plain data only for props. Complex objects like class instances do not serialize across the browser boundary. Pass plain objects, strings, numbers, and dates only.
- Callbacks are async. Event handler callbacks run in Node.js while the component runs in the browser. Synchronous return values from callbacks do not work.
Supported TestDino Features
All TestDino features work with component tests the same way as E2E tests.Annotations
Add metadata and Slack alerts to tests
Code Coverage
Track coverage per test run
Flaky Test Detection
Identify and track flaky tests
Real-Time Streaming
Monitor live test execution