59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
/**
|
|
* QA-1: App-weite E2E-Smoke-Suite (Playwright, getrennt von vitest).
|
|
*
|
|
* Zwei Betriebsarten:
|
|
* - MOCK (Standard): startet den Vite-Dev-Server auf :5199 und fängt alle
|
|
* API-Aufrufe per Route-Interception ab (Fixtures nach DATA-2-Vertrag,
|
|
* siehe e2e/mock-api.ts). Kein Backend nötig.
|
|
* - LIVE: `E2E_BASE_URL` zeigt auf das laufende Frontend (z. B. via Aspire
|
|
* AppHost); es wird NICHT gemockt und kein Dev-Server gestartet.
|
|
* Fixture-gebundene Tests überspringen sich dann selbst.
|
|
*
|
|
* Viewports: Smartphone (390px, mobile-first) und Laptop (1280px) — jede
|
|
* Spec läuft in beiden Projekten.
|
|
*/
|
|
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
const LIVE_BASE_URL = process.env.E2E_BASE_URL
|
|
const MOCK_PORT = 5199
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 1 : 0,
|
|
reporter: [['list']],
|
|
timeout: 30_000,
|
|
use: {
|
|
baseURL: LIVE_BASE_URL ?? `http://localhost:${MOCK_PORT}`,
|
|
locale: 'de-DE',
|
|
trace: 'retain-on-failure',
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'phone',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
viewport: { width: 390, height: 844 },
|
|
deviceScaleFactor: 2,
|
|
hasTouch: true,
|
|
},
|
|
},
|
|
{
|
|
name: 'desktop',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
viewport: { width: 1280, height: 800 },
|
|
},
|
|
},
|
|
],
|
|
webServer: LIVE_BASE_URL
|
|
? undefined
|
|
: {
|
|
command: `npm run dev -- --port ${MOCK_PORT} --strictPort`,
|
|
url: `http://localhost:${MOCK_PORT}`,
|
|
reuseExistingServer: true,
|
|
timeout: 60_000,
|
|
},
|
|
})
|