Skip to content

Add Playwright E2E test infrastructure with 40 passing tests - #534

Merged
tilloh-dev merged 7 commits into
mainfrom
feature/playwright-e2e-infrastructure
Mar 22, 2026
Merged

Add Playwright E2E test infrastructure with 40 passing tests#534
tilloh-dev merged 7 commits into
mainfrom
feature/playwright-e2e-infrastructure

Conversation

@tilloh-dev

Copy link
Copy Markdown
Owner

Summary

  • Add full Playwright E2E test infrastructure in /e2e/ with its own package.json, tsconfig.json, and playwright.config.ts
  • 40 passing tests across 9 spec files: auth/login, navigation/home, features/about, features/uno-sort, features/jokes, features/admin, features/memorandum, features/todo, features/settings
  • Auth bypass via localStorage injection (no UI login needed for most tests)
  • Global setup/teardown creates and cleans up test data via backend API; writes frontend/static/config/config.json to point the frontend at the E2E backend port (61155)
  • All source code comments translated from German to English

Test plan

  • Run npm run e2e:install to install Playwright + Chromium
  • Copy .env.test.example to .env.test and fill in values
  • Start MongoDB: cd backend && npm run start:db
  • Run npm run e2e — all 40 tests should pass
  • Run npm run e2e:headed — verify browser interactions visually

🤖 Generated with Claude Code

timlohse1104 and others added 4 commits March 22, 2026 19:38
… 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 tilloh-dev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' }],
//                           ^^^^^^^^ Tippfehler

Sollte 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
### Struktur

Da 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, ohne page.goto() vor dem Script
  • Separate E2E-Datenbank (tilloh-dev-e2e) — kein Risiko für Dev-Daten
  • @Public() auf /health/readyz — korrekte Minimal-Änderung damit webServer health-check ohne Token funktioniert
  • toBeEditable() vor fill() — sauberes Handling der Carbon Modal Animation
  • .create_list_section statt .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 tilloh-dev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Deutsch

Fix:

// 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 Scope
  • FRONTEND_CONFIG_FILE zentralisiert in helpers/constants.ts
  • toBeEditable() vor fill() — sauberes Carbon-Modal-Handling
  • .create_list_section Selektor — 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 ⚠️

timlohse1104 and others added 2 commits March 22, 2026 22:16
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>
@tilloh-dev
tilloh-dev merged commit 2a0fadb into main Mar 22, 2026
2 checks passed
@tilloh-dev
tilloh-dev deleted the feature/playwright-e2e-infrastructure branch March 22, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant