All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 1m42s
Automatisierte End-to-End-Tests gegen ein deployed Environment. Loest die manuellen MCP-Playwright-Runs ab. 42 Tests in 9 Files: - homepage: H1, Sektionen, Sort-Tabs, Console-Errors - search: lokaler Treffer, Web-Fallback, Empty-State, Deep-Link - profile: Switcher, Auswahl-Persistenz, Favoriten-Section, Guard-Dialog - recipe-detail: Header, Portionen-Scaling (4->6), Favorit-Toggle, Rating-Persistenz ueber Reload, Gekocht-Counter, Wunschliste-Toggle - comments: eigenen erstellen+loeschen via UI, fremder hat kein Delete - wishlist: Seite, Sort-Tabs, Badge-Sync, requireProfile-Custom-Message - preview: Guard ohne ?url=, echte URL parst, unparsbare zeigt error-box - admin: alle 4 Subrouten + /admin redirect - api-errors: parsePositiveIntParam (4x Invalid id), validateBody (4x Invalid body + issues), 404, Sanity /health /profiles /domains Architektur: - Separate playwright.remote.config.ts (getrennt von local preview) - workers: 1 + afterEach API-Cleanup (rating, favorite, wishlist, comments) - Hardcoded Recipe-ID 66 + Profile 1/2/3 — stabile Dev-DB-Seeds - E2E_REMOTE_URL ueberschreibt die Ziel-URL Ausfuehrung: npm run test:e2e:remote Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
888 B
TypeScript
27 lines
888 B
TypeScript
import type { Page } from '@playwright/test';
|
|
|
|
// Profil-IDs auf kochwas-dev: 1 = Hendrik, 2 = Verena, 3 = Leana.
|
|
// Die Tests hardcoden Hendrik als Standard, weil die Dev-DB diese
|
|
// Profile stabil enthaelt.
|
|
export const HENDRIK_ID = 1;
|
|
export const VERENA_ID = 2;
|
|
export const LEANA_ID = 3;
|
|
|
|
/**
|
|
* Setzt das aktive Profil in localStorage, BEVOR die Seite geladen wird.
|
|
* addInitScript laeuft vor jedem Skript der Seite — damit ist das Profil
|
|
* schon da, wenn profileStore.load() das erste Mal liest.
|
|
*/
|
|
export async function setActiveProfile(page: Page, id: number): Promise<void> {
|
|
await page.addInitScript(
|
|
(pid) => window.localStorage.setItem('kochwas.activeProfileId', String(pid)),
|
|
id
|
|
);
|
|
}
|
|
|
|
export async function clearActiveProfile(page: Page): Promise<void> {
|
|
await page.addInitScript(() =>
|
|
window.localStorage.removeItem('kochwas.activeProfileId')
|
|
);
|
|
}
|