@react-app-boilerplate/playwright-config
v0.1.0
Published
Shared Playwright configuration factory: CI-aware retries/workers, HTML report, webServer auto-starting Vite.
Maintainers
Readme
@react-app-boilerplate/playwright-config
Shared Playwright configuration for Vite-based React apps.
- CI-aware: 2 retries / 1 worker / HTML + GitHub reporters when
CI=true;listreporter locally. - Trace on first retry, screenshot only on failure.
webServerauto-starts Vite (pnpm dev) from the parent directory (cwd: '..'). matches the plan'se2e/colocation.- MSW handlers flow to Playwright via the dev server (which registers the service worker in dev).
Usage
// e2e/playwright.config.ts
import { defineConfig } from '@playwright/test';
import { playwrightViteConfig } from '@react-app-boilerplate/playwright-config';
export default defineConfig(playwrightViteConfig());Overrides
import { defineConfig, devices } from '@playwright/test';
import { playwrightViteConfig } from '@react-app-boilerplate/playwright-config';
export default defineConfig(
playwrightViteConfig({
baseURL: 'http://localhost:4173',
webServerCommand: 'pnpm preview',
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
],
}),
);