React playground

Nova v3.37.0

Preview

React

Playwright E2E

Playwright E2E Guide for Nova React Consumers

This guide mirrors the canonical Nova Playwright approach and focuses on what matters for React + web component integration.

Why Playwright

  • Real integration path: validates browser DOM event -> React state/event handling updates.
  • Lower flakiness: auto-waiting and retryable assertions reduce async timing failures.
  • Audit evidence: built-in traces, screenshots, and videos.
  • Operational simplicity: no separate WebDriver binary lifecycle.

Minimal Setup

bashnpm install -D @playwright/test
npx playwright install
ts// playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  testDir: './tests/e2e',
  retries: process.env.CI ? 2 : 0,
  use: {
    headless: true,
    trace: 'on-first-retry',
  },
  projects: [{ name: 'chromium', use: { browserName: 'chromium' } }],
});

Test Scope Configuration (include/exclude)

Documenting include/exclude is important for maintainability and audit clarity.

ts// playwright.config.ts
export default defineConfig({
  testDir: './tests',
  testMatch: ['**/*.e2e.spec.ts'],
  testIgnore: ['**/helpers/**', '**/*.unit.spec.ts', '**/dist/**'],
});

React-Relevant Example

tsimport { test, expect } from '@playwright/test';

test('React page renders and reacts to Nova interaction', async ({ page }) => {
  await page.goto('/');

  await expect(page.locator('nv-button')).toBeVisible();

  // stable selector pattern
  await page.locator('[data-scope="close-alert"]').click();
});

Use data-scope / data-testid selectors for stable tests.

M1 / On-Prem Note

This is documented in internal documentation only: Elia Group M1 usage documentation

Further Reading