Skip to main content
Playwright component testing mounts UI components in a real browser without a full application. TestDino supports component tests with traces, screenshots, videos, and AI insights, the same as E2E tests.
WarningComponent testing requires @testdino/playwright. See Real-Time Streaming for setup.

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:
2

Install the TestDino reporter

View TestDino npm package for @testdino/playwright ↗
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:
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
All standard reporter options work with component tests: debug, ciRunId, artifacts, and coverage. See the Node.js CLI reference for the full list.
TipEnable trace, screenshot, and video in the config. These artifacts upload to TestDino and appear in the test case detail page for debugging.

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.
All standard Playwright options work:

CI Integration

Component tests run in CI the same way as E2E tests. Set TESTDINO_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.
For full API details on props, events, slots, and hooks, see the Playwright component testing documentation.

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