Skip to content

Latest commit

 

History

History
277 lines (210 loc) · 7.72 KB

File metadata and controls

277 lines (210 loc) · 7.72 KB

Test Scenarios: Implementation Summary

Overview

Created 4 focused test scenarios to validate each Phase 1-5 feature independently:

Test Phase Feature Duration
test_timer_system 5 Countdown timer HUD widget 3-5 min
test_npc_patrol_override 2-4 Emergency patrol override + speed 1-2 min
test_npc_visibility 3 Hidden NPC visibility toggle 1 min
test_event_cascade 1-2 Event-driven multi-NPC reactions 2-3 min

Files Created

Scenario JSON Files (in /scenarios/)

test_timer_system.json (44 lines)

  • 3 timers with configurable delays (30s, 2min, 5min)
  • Timer widget urgency testing (amber < 5min, red < 1min)
  • NPC dialogue on timer fire
  • Conditions prevent firing if criteria not met

test_npc_patrol_override.json (89 lines)

  • Nurse on 3-waypoint patrol loop
  • Emergency button triggers patrolOverride action
  • Tests goToAndStay() method + speed increase
  • Monitor NPC confirms emergency response

test_npc_visibility.json (78 lines)

  • Pharmacist hidden at start (initiallyHidden: true)
  • Dispatch button triggers setVisible: true action
  • Tests visibility toggle on hidden NPC
  • Patrol begins after reveal

test_event_cascade.json (132 lines)

  • 3 NPCs: Patient, Nurse, Manager
  • Part 1: Patient alert → nurse moves to patient
  • Part 2: Major incident → all NPCs respond, speed/dwell override
  • Tests condition evaluation and multi-NPC coordination

Total JSON: 343 lines


Ink Story Files (in /scenarios/test_scenarios/ink/)

test_timer_monitor.ink (10 lines)

  • Idle state + 3 alert states
  • Fires when timers complete

test_nurse.ink (10 lines)

  • Patrol idle + emergency response states
  • Fires when emergency activated

test_monitor.ink (10 lines)

  • Patrol monitor
  • Fires on alert

test_pharmacist.ink (10 lines)

  • Start + arrival states
  • Fires when dispatched (setVisible)

test_dispatcher.ink (10 lines)

  • Dispatcher controller
  • Confirms dispatch

test_patient.ink (15 lines)

  • Stable → alert → critical states
  • Progressive dialogue as event cascade progresses

test_cascade_nurse.ink (12 lines)

  • Patrol idle + alert response + incident response
  • Reacts to both events independently

test_manager.ink (10 lines)

  • Monitoring + escalation protocol
  • Fires on incident declaration

Total Ink: 87 lines across 8 files


Documentation Files

TEST_SCENARIOS_README.md (250+ lines)

  • Complete guide for each scenario
  • Expected behavior and outcomes
  • Debugging tips per feature
  • Test checkklist for validation
  • Related files and CI/CD integration

TEST_SCENARIOS_QUICKSTART.md (180+ lines)

  • Launch URLs for each test
  • Local server setup
  • Validation commands
  • Test matrix
  • Manual test checklist
  • Troubleshooting guide

Validation Results

All test scenarios pass validation:

✓ test_timer_system.json       — ERB OK, JSON OK, Ink OK
✓ test_npc_patrol_override.json — ERB OK, JSON OK, Ink OK
✓ test_npc_visibility.json     — ERB OK, JSON OK, Ink OK
✓ test_event_cascade.json      — ERB OK, JSON OK, Ink OK

Feature Coverage

Phase 5: Timer System

  • ✅ Countdown widget displays correctly
  • ✅ mm:ss format
  • ✅ Color transitions (white → amber → red)
  • ✅ Pulsing animation at < 1min
  • ✅ Timer execution and event firing
  • ✅ Condition guards
  • Test: test_timer_system.json

Phase 2-4: Patrol Override & Speed Control

  • patrolOverride action interrupts patrol
  • goToAndStay() method forces specific location
  • setPatrolSpeed increases movement speed
  • ✅ Speed increase is visibly noticeable (~1.9x)
  • ✅ NPC stops at destination
  • Test: test_npc_patrol_override.json

Phase 3: Visibility Toggle

  • initiallyHidden: true hides NPC at spawn
  • setVisible action reveals hidden NPC
  • ✅ Visibility toggle is immediate (no fade)
  • ✅ NPC becomes interactive after reveal
  • ✅ Physics body enabled when revealed
  • Test: test_npc_visibility.json

Phase 1-2: Event-Driven Cascades

  • ✅ Global variable broadcasts to multiple NPCs
  • ✅ Conditional event filtering
  • onceOnly flag prevents duplicates
  • ✅ Multi-NPC coordinated reactions
  • ✅ Sequential action execution
  • ✅ Event chaining (one event triggers multiple NPCs)
  • Test: test_event_cascade.json

How to Run Tests

1. Start Local Server

cd /home/cliffe/Files/Projects/Code/BreakEscape/BreakEscape
python3 -m http.server

2. Load Test Scenario

http://localhost:8000/scenario_select.html?scenario=test_timer_system
http://localhost:8000/scenario_select.html?scenario=test_npc_patrol_override
http://localhost:8000/scenario_select.html?scenario=test_npc_visibility
http://localhost:8000/scenario_select.html?scenario=test_event_cascade

3. Follow In-Game Instructions

Each scenario includes detailed test instructions in both:

  • Mission brief (displayed on load)
  • On-screen notes (readable objects)

Test Procedures Reference

Timer System (3-5 minutes)

  1. Observe timer widget (top-right)
  2. Watch countdown from 0:30
  3. Observe color: amber (< 5min)
  4. Observe color: red + pulse (< 1min)
  5. Verify 3 timers fire and NPCs react

Patrol Override (1-2 minutes)

  1. Observe normal patrol
  2. Press emergency button
  3. Verify nurse interrupts patrol immediately
  4. Verify speed increases noticeably
  5. Verify nurse stops at destination

Visibility Toggle (1 minute)

  1. Confirm pharmacist not visible at start
  2. Press dispatch button
  3. Verify pharmacist appears instantly
  4. Verify pharmacist becomes interactive
  5. Observe pharmacist begins patrol

Event Cascade (2-3 minutes)

  1. Part 1: Click patient bed
    • Patient alerts
    • Nurse moves to patient
    • Manager acknowledges
  2. Part 2: Click alarm button
    • All NPCs escalate response
    • Nurse speeds up
    • Nurse dwell time decreases
    • Full cascade dialogue plays

Files Summary

Scenario JSON

  • Path: /scenarios/
  • Files: 4 JSON files
  • Total lines: 343

Ink Stories

  • Path: /scenarios/test_scenarios/ink/
  • Files: 8 INK files
  • Total lines: 87

Documentation

  • Path: / (root)
  • Files: 2 markdown guides
  • Total lines: 430+

Total Creation

  • 16 files created
  • 860+ lines of code/docs
  • All validated and ready for testing

Next Steps

  1. Created: 4 test scenarios + 8 Ink files + documentation
  2. Validated: All scenarios pass JSON/Ink/schema checks
  3. 📋 Ready for: Manual playtesting
  4. 📋 Optional: Automated headless browser testing
  5. 📋 Optional: CI/CD integration

Key Testing Points

Use these validation points when running tests:

  • Timer Widget Accuracy: Countdown should be smooth and accurate within 100ms
  • Speed Visibility: Emergency movement should be noticeably faster (1.9x)
  • Visibility Immediacy: NPC appearance should be instant, no fade-in
  • Event Dispatch: All listening NPCs should receive broadcasts
  • Condition Guards: Events should only fire when conditions are met
  • onceOnly Enforcement: Events should only fire once per scenario

Integration with Main Scenario

These test scenarios complement the full healthcare scenario:

  • scenarios/sis01_healthcare/scenario.json.erb — Full implementation (1000+ lines)
  • scenarios/test_*.json — Focused feature tests (minimal setup)

Run the full scenario for complete gameplay, or individual test scenarios for specific feature validation.


Support

For detailed information:

  • See: TEST_SCENARIOS_README.md — Complete guide with procedures
  • See: TEST_SCENARIOS_QUICKSTART.md — Quick reference and URLs
  • See: IMPLEMENTATION_COMPLETE_PHASES_1-5.md — Implementation details