Files
Mana-Loop/docs/tasks/TASK-001-playwright-setup.md
T
n8n-gitea 47b2a0bdc7
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 33s
feat: TASK-001 - Playwright E2E test setup + baseline tests
- Added @playwright/test as dev dependency
- Created playwright.config.ts with Chromium config and webServer setup
- Created e2e/combat.spec.ts (5 tests for spire mode, floor display)
- Created e2e/enchanting.spec.ts (4 tests for design/crafting tab, enchant flow)
- Created e2e/equipment.spec.ts (5 tests for equip, slots, 2H blocking)
- Created docs/tasks/TASK-001-playwright-setup.md
- All 13 E2E tests passing
2026-05-11 13:25:57 +02:00

2.2 KiB

TASK-001: Playwright Setup + Baseline E2E Tests

Objective

Add Playwright E2E testing to the Mana Loop project and create baseline tests that validate core gameplay systems work correctly. This establishes the test safety net required before any refactoring work begins.

Acceptance Criteria

  1. Playwright is installed and configured (playwright.config.ts exists)
  2. e2e/ directory exists with at least 3 passing test files
  3. All baseline E2E tests pass (npx playwright test succeeds)
  4. Tests cover: enchanting flow (3-step), equipment equipping (2H block), and combat progression

Tasks

Step 1: Install Playwright and create config

  • Run npx playwright install and add @playwright/test to devDependencies
  • Create playwright.config.ts with appropriate viewport, baseURL, and testDir settings
  • Verify: npx playwright --version works
  • Files: package.json, playwright.config.ts

Step 2: Create baseline enchanting E2E test

  • Create e2e/enchanting.spec.ts testing:
    • Page loads and game initializes
    • Player can navigate to Crafting tab
    • Effect selection works (select an effect from unlocked pool)
    • Design → Prepare → Apply flow completes
  • File: e2e/enchanting.spec.ts

Step 3: Create baseline equipment E2E test

  • Create e2e/equipment.spec.ts testing:
    • Player can equip items from inventory
    • 2H weapon blocks offhand slot
    • Unequipping returns item to inventory
  • File: e2e/equipment.spec.ts

Step 4: Create baseline combat E2E test

  • Create e2e/combat.spec.ts testing:
    • Player enters combat (clicks "Climb the Spire")
    • Spell casting progresses over time
    • Enemy HP decreases on spell completion
    • Floor advances after clearing
  • File: e2e/combat.spec.ts

Step 5: Run tests and fix issues

  • Run npx playwright test and ensure all tests pass
  • Run npx playwright test --headed to visually verify if needed
  • Fix any test flakes or timing issues

Files to be touched

  • package.json — add @playwright/test dependency
  • playwright.config.ts — NEW file
  • e2e/enchanting.spec.ts — NEW file
  • e2e/equipment.spec.ts — NEW file
  • e2e/combat.spec.ts — NEW file

Dependencies

  • None (first task in sequence)

Time Estimate: ~2 hours