test(e2e): Playwright Smoketests gegen kochwas-dev (remote)
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 1m42s
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>
This commit is contained in:
32
tests/e2e/remote/search.spec.ts
Normal file
32
tests/e2e/remote/search.spec.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Suche', () => {
|
||||
test('lokaler Treffer erscheint live beim Tippen', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.getByRole('searchbox', { name: 'Suchbegriff' }).fill('lasagne');
|
||||
await expect(page.getByRole('link', { name: /Pfannen Lasagne/i })).toBeVisible({
|
||||
timeout: 5000
|
||||
});
|
||||
});
|
||||
|
||||
test('Web-Fallback bei unbekanntem Begriff', async ({ page }) => {
|
||||
// Direkt per URL — spart den Debounce-Timer.
|
||||
await page.goto('/?q=pizza+margherita');
|
||||
await expect(page.getByText(/Keine lokalen Rezepte/i)).toBeVisible({ timeout: 15000 });
|
||||
// Mindestens ein Web-Treffer mit einer Domain-Labeling.
|
||||
await expect(page.getByText(/chefkoch\.de|rezeptwelt\.de/i).first()).toBeVisible();
|
||||
});
|
||||
|
||||
test('echter Empty-State bei Nonsense-Begriff', async ({ page }) => {
|
||||
await page.goto('/?q=xxyyzznotarecipexxxxxxxx');
|
||||
await expect(
|
||||
page.getByText(/Schaue unter den Topfdeckeln|Noch nichts gefunden|keine Rezepte/i)
|
||||
).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test('Deep-Link ?q=lasagne stellt Query im Input wieder her', async ({ page }) => {
|
||||
await page.goto('/?q=lasagne');
|
||||
const sb = page.getByRole('searchbox', { name: 'Suchbegriff' });
|
||||
await expect(sb).toHaveValue('lasagne');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user