Files
stack/apps/web/playwright.config.ts
Jason Woltje a7804e689d
Some checks failed
ci/woodpecker/push/ci Pipeline failed
feat(web): add Playwright E2E test suite for critical paths (#55)
Sets up @playwright/test in apps/web with playwright.config.ts
targeting localhost:3000. Adds E2E test coverage for all critical paths:
auth (login/register/validation), chat (page load, new conversation),
projects (list, empty state), settings (4 tab switches), admin (tab
switching, role guard), and navigation (sidebar links, route transitions).

Includes auth helper, separate tsconfig.e2e.json, and allowDefaultProject
ESLint config so e2e files pass the pre-commit hook. Adds pnpm test:e2e script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 14:34:31 -05:00

33 lines
924 B
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Playwright E2E configuration for Mosaic web app.
*
* Assumes:
* - Next.js web app running on http://localhost:3000
* - NestJS gateway running on http://localhost:4000
*
* Run with: pnpm --filter @mosaic/web test:e2e
*/
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env['CI'],
retries: process.env['CI'] ? 2 : 0,
workers: process.env['CI'] ? 1 : undefined,
reporter: 'html',
use: {
baseURL: process.env['PLAYWRIGHT_BASE_URL'] ?? 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
// Do NOT auto-start the dev server — tests assume it is already running.
// webServer is intentionally omitted so tests can run against a live env.
});