47b2a0bdc7
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 33s
- 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
2.2 KiB
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
- Playwright is installed and configured (
playwright.config.tsexists) e2e/directory exists with at least 3 passing test files- All baseline E2E tests pass (
npx playwright testsucceeds) - Tests cover: enchanting flow (3-step), equipment equipping (2H block), and combat progression
Tasks
Step 1: Install Playwright and create config
- Run
npx playwright installand add@playwright/testto devDependencies - Create
playwright.config.tswith appropriate viewport, baseURL, and testDir settings - Verify:
npx playwright --versionworks - Files:
package.json,playwright.config.ts
Step 2: Create baseline enchanting E2E test
- Create
e2e/enchanting.spec.tstesting:- 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.tstesting:- 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.tstesting:- 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 testand ensure all tests pass - Run
npx playwright test --headedto visually verify if needed - Fix any test flakes or timing issues
Files to be touched
package.json— add @playwright/test dependencyplaywright.config.ts— NEW filee2e/enchanting.spec.ts— NEW filee2e/equipment.spec.ts— NEW filee2e/combat.spec.ts— NEW file
Dependencies
- None (first task in sequence)