familynido/web/familynido-web/playwright.config.ts
Pablo Fernández a308041d59 Initial commit
FamilyNido — a self-hosted PWA for a single household: shared calendar,
chores, meals, school agenda, health records and a family wall. One
instance per family, deployable with `docker compose` on any home
server.

Stack: .NET 10 (ASP.NET Core Minimal APIs) + EF Core 10 + PostgreSQL 16
on the backend, Angular 21 (standalone, signals, zoneless) + Tailwind
CSS v4 on the frontend, SignalR for realtime, optional OIDC alongside
local credentials, integration via a versioned `/api/v1/**` public API.

See README.md for the module overview and how to deploy.
2026-05-13 00:23:14 +02:00

57 lines
2 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Playwright config for the FamilyNido E2E suite.
*
* The tests target a *running* deployment of the app — they do not start
* the API or the database themselves. The simplest way to use them is:
*
* 1. Have docker compose dev (or prod) running locally.
* 2. Have a `FamilyMember` linked to a user whose `Local` credential
* has a known password set via /account -> "Establecer contraseña".
* 3. Export the four env vars below before running `npm run e2e`.
*
* E2E_BASE_URL — e.g. http://localhost:5173 or http://familynido.local
* E2E_USER_EMAIL — email of the primary test user (tester A)
* E2E_USER_PASSWORD — its local password
* E2E_USER_B_EMAIL — email of the secondary test user (tester B), only
* needed for *.b.spec.ts multi-user specs
* E2E_USER_B_PASSWORD — its local password
*
* See e2e/README.md for the full setup notes.
*/
const baseURL = process.env['E2E_BASE_URL'] ?? 'http://localhost:5173';
export default defineConfig({
testDir: './e2e',
// Storage state produced by auth.setup.ts so each spec starts authenticated.
fullyParallel: false,
forbidOnly: !!process.env['CI'],
retries: 0,
workers: 1,
reporter: process.env['CI'] ? 'github' : [['list']],
use: {
baseURL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
// The "setup" project authenticates once per user and writes a storage-state
// file; every other project depends on it and reuses the cookie so tests
// don't re-login on every spec. Multi-user specs (`*.b.spec.ts`) drive two
// contexts in the same test via the `pageB` fixture in `e2e/fixtures.ts`.
projects: [
{
name: 'setup',
testMatch: /.*\.setup\.ts$/,
},
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
storageState: 'e2e/.auth/state.json',
},
dependencies: ['setup'],
},
],
});