DocumentationTest AuthoringComponent testing (Playwright 1.42)

Component testing (Playwright 1.42)

8 min readLast updated 2026-04-27New

Test React, Vue, and Svelte components in isolation with Playwright component testing, integrated into Check Studio.

Component testing lets you test UI components in isolation without spinning up the full app. It uses the same Playwright engine and assertions as your E2E tests.

Setup

  1. 1Install the component testing add-on: npm install -D @checkstudio/component-testing
  2. 2Create a .spec.tsx file next to your component
  3. 3Mount the component and interact with it using Playwright APIs
import { test, expect } from '@checkstudio/component-testing';
import { Button } from './Button';

test('button renders and clicks', async ({ mount }) => {
  const component = await mount(<Button>Click me</Button>);
  await component.click();
  await expect(component).toHaveText('Clicked');
});
typescript

Running component tests

checkstudio run --mode=component
bash

CI integration

Component tests run in the same CI pipeline as E2E tests. Results appear on the same dashboard for unified reporting.

Was this article helpful?

Still have questions?

Our support team is here to help. Reach out directly or search the docs.