This document describes how to manually test the Pattern Weaver RPG vertical slice.
Vertical Slice: Hub → Combat → Victory → Hub
-
Start Dev Server:
cd C:\Users\decro\pattern-weaver npm run dev
-
Open Browser:
- Navigate to the URL shown (e.g., http://localhost:3001)
- Open browser console (F12) to see debug logs
Steps:
- Game loads
- LoadingScene appears briefly with "Pattern Weaver - Loading..."
- Transitions to HubScene automatically
Expected Result:
- ✓ Dark blue background (#1a1a2e)
- ✓ Title text "Welcome to Ravensholm" at top center
- ✓ 4 colored buildings visible:
- Inn (blue, top-left)
- Shop (red, top-right)
- Battle Gate (purple, bottom-left)
- Quest Board (green, bottom-right)
- ✓ Each building has label text below it
Success Criteria:
- All 4 buildings render
- No console errors
- Buildings respond to hover (scale up, darken)
Steps:
- Hover over "Battle Gate" (purple building, bottom-left)
- Click "Battle Gate"
Expected Result:
- ✓ Fade transition (300ms)
- ✓ CombatScene loads
- ✓ Console shows:
CombatScene: Initializing combat with enemy type: slime
Success Criteria:
- Scene transition is smooth
- No visual glitches
- Console log confirms enemy type
Steps:
- Observe CombatScene layout after transition
Expected Result:
Left Side (Player):
- ✓ Blue square (40x40 pixels)
- ✓ "Player" label
- ✓ Green health bar showing "HP: 100/100"
- ✓ Blue mana bar showing "MP: 50/50"
- ✓ Text showing "Level 1 | XP: 0/100"
Right Side (Enemy):
- ✓ Green circle (30px diameter)
- ✓ "Slime" label
- ✓ Red health bar showing "HP: 30/30"
Bottom Bar:
- ✓ Dark panel (1280x80)
- ✓ Three purple buttons: "Attack", "Defend", "Flee"
Success Criteria:
- All UI elements render correctly
- Health/mana bars show correct values
- Buttons are clickable (cursor changes on hover)
Steps:
- Click "Attack" button
Expected Result:
- ✓ Damage number appears above enemy (e.g., "-8")
- ✓ Enemy health bar decreases (e.g., 30 → 22)
- ✓ Enemy health label updates (e.g., "HP: 22/30")
- ✓ Short delay (~500ms)
- ✓ Enemy counter-attacks
- ✓ Damage number appears above player (e.g., "-3")
- ✓ Player health bar decreases
- ✓ Console shows combat log:
Turn 1: You attack Slime for 8 damage! Turn 1: Slime attacks you for 3 damage!
Success Criteria:
- Damage numbers appear and fade out (1 second)
- Health bars animate smoothly (300ms)
- Turn completes without errors
- Buttons re-enable after turn
Steps:
- Click "Defend" button
Expected Result:
- ✓ Console shows:
Turn X: You defend! Defense increased. - ✓ Enemy attacks
- ✓ Reduced damage taken (defense boost active)
- ✓ Health bar updates
Success Criteria:
- Defend reduces incoming damage
- Turn completes successfully
Steps:
- Click "Attack" repeatedly until enemy HP reaches 0
- Observe what happens when enemy dies
Expected Result:
- ✓ Enemy health reaches 0
- ✓ All combat UI elements fade out or hide
- ✓ Large text appears: "Victory!"
- ✓ Text appears: "You gained 10 XP!"
- ✓ Console shows:
Combat won! XP reward: 10 - ✓ After 2.5 seconds, fade transition to HubScene
- ✓ Player XP increased (check console:
Player XP: 10/100)
Success Criteria:
- Victory screen displays correctly
- XP is awarded
- Auto-return to Hub after delay
- Player XP persists (if level not gained)
Steps:
- Start new combat (click Battle Gate)
- Click "Flee" button
Expected Result:
- ✓ 50% chance to escape
- ✓ If success:
- Text appears: "You escaped!"
- Return to Hub after 2 seconds
- ✓ If fail:
- Text appears: "Couldn't escape!"
- Enemy attacks
- Combat continues
Success Criteria:
- Flee has random chance
- Successful flee returns to Hub
- Failed flee continues combat
Steps:
- Start new combat
- Click "Defend" or do nothing
- Let enemy reduce player HP to 0
Expected Result:
- ✓ Player health reaches 0
- ✓ Text appears: "Defeat..."
- ✓ Text appears: "You were defeated by Slime"
- ✓ Return to Hub after 2.5 seconds
- ✓ Console shows:
Combat lost!
Success Criteria:
- Defeat screen displays
- Return to Hub occurs
- No crashes or errors
Steps:
- Win a combat (gain 10 XP)
- Return to Hub
- Click Battle Gate again
- Win another combat
Expected Result:
- ✓ Player retains HP/MP/XP between combats
- ✓ XP accumulates (10 → 20 → 30, etc.)
- ✓ At 100 XP, player levels up:
- Level increases (1 → 2)
- HP increases (+10)
- MP increases (+5)
- Attack increases (+2)
- Defense increases (+1)
- Console shows:
Level up! Now level 2
Success Criteria:
- Player state persists
- XP accumulates correctly
- Level up triggers at 100 XP
- Stats increase as expected
During all tests, verify:
- ✓ No console errors
- ✓ Smooth 60 FPS (no lag or stutter)
- ✓ Transitions are smooth
- ✓ UI responds immediately to clicks
- ✓ Memory usage stable (no leaks)
Current vertical slice limitations:
- Only one enemy type (Slime) available from Hub
- To test Wolf/Goblin: Edit
HubScene.jsline 109, change'slime'to'wolf'or'goblin'
- To test Wolf/Goblin: Edit
- Player state resets on page refresh (no save system yet)
- No sound effects
- No animations beyond damage numbers and health bars
- No inventory interaction during combat
- No loot drops
Future enhancements:
- Enemy selection menu
- Critical hits (orange damage numbers ready)
- Combat log display
- Animation shake on hit
- Particle effects
- Save/load system
Scenes:
src/scenes/HubScene.js- Hub navigationsrc/scenes/CombatScene.js- Combat UI and integrationsrc/scenes/SceneManager.js- Scene transitions
Systems:
src/systems/CombatSystem.js- Turn-based combat logic
Entities:
src/entities/Player.js- Player stats and methodssrc/entities/Enemy.js- Enemy types and stats
UI Components:
src/ui/Button.js- Interactive buttonssrc/ui/HealthBar.js- Animated health barssrc/ui/ManaBar.js- Animated mana bars
Data:
data/enemies.json- Enemy definitionsdata/abilities.json- Attack data (future use)data/progression.json- Level/XP table
Services:
src/services/DataLoader.js- JSON data loading
Vertical slice is successful if:
- ✓ Hub loads without errors
- ✓ Can navigate to Combat scene
- ✓ Combat renders correctly (player, enemy, UI)
- ✓ Can attack and see damage/health updates
- ✓ Combat ends with victory or defeat
- ✓ Returns to Hub after combat
- ✓ Can repeat combat flow
- ✓ No crashes or console errors
- Test Case 1: Hub Scene Loads
- Test Case 2: Navigate to Combat
- Test Case 3: Combat Scene Renders
- Test Case 4: Attack Action
- Test Case 5: Defend Action
- Test Case 6: Combat to Victory
- Test Case 7: Flee Action
- Test Case 8: Combat to Defeat
- Test Case 9: Multiple Combats
- Performance Checks (no errors, smooth FPS)
Last Updated: 2026-04-22 Version: 1.0 (Vertical Slice) Status: Ready for Testing