Add Playwright E2E test infrastructure with 40 passing tests - #534
Conversation
… 6 spec files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tilloh-dev
left a comment
There was a problem hiding this comment.
PR Review — feature/playwright-e2e-infrastructure — 2026-03-22
⚠️ Suggestion: Verbliebener deutscher Kommentar
e2e/global-teardown.ts:33
// Frontend-Config wieder entfernen ← noch Deutsch
if (fs.existsSync(FRONTEND_CONFIG_FILE)) {Fix:
// Remove frontend config⚠️ Suggestion: Typo im Joke-Seed-Body
e2e/helpers/api.ts:64
categories: [{ name: 'e2e', languague: 'de' }],
// ^^^^^^^^ TippfehlerSollte language heißen. Das Feld wird vom Backend evtl. ignoriert, aber im Seed-Objekt ist es trotzdem falsch.
Fix:
categories: [{ name: 'e2e', language: 'de' }],⚠️ Suggestion: FRONTEND_CONFIG_FILE dupliziert
e2e/global-setup.ts:15-18 und e2e/global-teardown.ts:6-9 definieren beide:
const FRONTEND_CONFIG_FILE = path.resolve(
__dirname,
'../frontend/static/config/config.json',
);Der Pfad ist identisch — sollte als Konstante in e2e/helpers/constants.ts exportiert werden.
Fix:
// helpers/constants.ts
export const FRONTEND_CONFIG_FILE = path.resolve(
__dirname,
'../../frontend/static/config/config.json',
);⚠️ Suggestion: README.md E2E-Abschnitt auf Englisch
README.md:94-138 — Der neue E2E-Abschnitt wurde auf Deutsch verfasst, obwohl der Rest der README auf Englisch ist:
E2E-Tests laufen lokal mit Playwright gegen echtes Backend + MongoDB.
...
### Tests ausführen
### StrukturDa in diesem PR explizit alle deutschen Kommentare ins Englische übersetzt wurden, sollte dieser Abschnitt konsistent ebenfalls auf Englisch sein.
✅ Gut gelöst
- Auth-Bypass via
addInitScript— saubere Lösung ohne UI-Login, ohnepage.goto()vor dem Script - Separate E2E-Datenbank (
tilloh-dev-e2e) — kein Risiko für Dev-Daten @Public()auf/health/readyz— korrekte Minimal-Änderung damitwebServerhealth-check ohne Token funktionierttoBeEditable()vorfill()— sauberes Handling der Carbon Modal Animation.create_list_sectionstatt.bx--modal.is-visible— vermeidet Race Condition beim schließenden Side-Menu-Modal- Global Setup/Teardown — vollständige Cleanup-Logik inkl.
frontend/static/config/config.json - 40 Tests, alle grün, 9 Spec-Dateien mit guter Feature-Abdeckung
STATISTIK:
🚫 Blocker: 0
⚠️ Suggestion: 4
✅ Gut: 6
VERDICT: APPROVED WITH SUGGESTIONS ⚠️
- Fix typo: languague -> language in api.ts joke seed - Extract FRONTEND_CONFIG_FILE constant to helpers/constants.ts to remove duplication - Translate remaining German comment in global-teardown.ts to English - Translate README.md E2E section from German to English for consistency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tilloh-dev
left a comment
There was a problem hiding this comment.
PR Review — feature/playwright-e2e-infrastructure — 2026-03-22 (Post-Fix)
⚠️ Suggestion: waitForLoadState('networkidle') deprecated
e2e/tests/navigation/home.spec.ts:9
waitForLoadState('networkidle') ist in Playwright deprecated. Die nächste Zeile (expect(main).toBeVisible()) wartet bereits hinreichend.
Fix: Zeile entfernen.
⚠️ Suggestion: Verbliebener deutscher Kommentar
e2e/tests/features/memorandum.spec.ts:65
// Speichern ← noch DeutschFix:
// Save⚠️ Suggestion: .gitignore endet ohne Newline
.gitignore:53 — \ No newline at end of file. POSIX-Konvention — einige Tools/Diffs warnen bei fehlendem Newline am Dateiende.
Fix: Abschließende Leerzeile anhängen.
⚠️ Suggestion: CHANGELOG mischt Deutsch und Englisch
CHANGELOG.md:10 — Der "Changed"-Eintrag ist auf Englisch, während die "Added"-Einträge auf Deutsch sind. Bestehende CHANGELOG-Einträge sind Deutsch.
Fix:
### Changed
- [global] Alle deutschen Source-Code-Kommentare ins Englische übersetzt (E2E-Specs, Frontend-Komponenten, Utility-Dateien).✅ Gut gelöst
- Auth-Bypass via
addInitScript— saubere Lösung ohne UI-Login - Separate E2E-Datenbank (
tilloh-dev-e2e) — kein Risiko für Dev-Daten @Public()auf/health/readyz— minimaler ScopeFRONTEND_CONFIG_FILEzentralisiert inhelpers/constants.tstoBeEditable()vorfill()— sauberes Carbon-Modal-Handling.create_list_sectionSelektor — vermeidet Race Condition- Global Setup/Teardown — vollständige Cleanup-Logik
- Typo + README-Übersetzung korrekt gefixt im letzten Commit
- 40 Tests, 9 Spec-Dateien mit guter Feature-Abdeckung
STATISTIK:
🚫 Blocker: 0
⚠️ Suggestion: 4
✅ Gut: 9
VERDICT: APPROVED WITH SUGGESTIONS ⚠️
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…estions - Add Language Policy section to CLAUDE.md requiring English for all code, comments, CHANGELOG entries, commit messages, and test descriptions - Translate E2E section in CLAUDE.md and all German CHANGELOG entries to English - Add e2e/ directory to architecture tree in CLAUDE.md - Fix remaining review suggestions: remove deprecated waitForLoadState, translate last German comment in memorandum spec, add trailing newline to .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
/e2e/with its ownpackage.json,tsconfig.json, andplaywright.config.tsauth/login,navigation/home,features/about,features/uno-sort,features/jokes,features/admin,features/memorandum,features/todo,features/settingsfrontend/static/config/config.jsonto point the frontend at the E2E backend port (61155)Test plan
npm run e2e:installto install Playwright + Chromium.env.test.exampleto.env.testand fill in valuescd backend && npm run start:dbnpm run e2e— all 40 tests should passnpm run e2e:headed— verify browser interactions visually🤖 Generated with Claude Code