Encounter Acceptance Test Plan - UQcsse3200/2026-studio-3 GitHub Wiki
Encounter Acceptance Test Plan
Feature: Non-Battle Encounters
Owner: Guoqing Sun (@Sunqing050114)
Sprint: 2
Parent issue: #127 Non-Battle Encounter Expansion and Cross-System Integration
Last updated: 15 September 2026
Purpose
This plan validates the integrated Chance and Shop encounter flow after Team 2 is connected to the Map, Player, Card and Deck systems. It focuses on complete player journeys and cross-system state invariants rather than repeating feature-level unit tests owned by individual developers.
The page belongs under the logical Encounters documentation group. Test implementation remains in the repository; the test plan and manual execution record live in the Wiki.
Integration overview
sequenceDiagram
participant Map as Map Screen
participant Screen as Encounter Screen
participant Encounter as Chance or Shop
participant State as Run State
Map->>Screen: Open EVENT or SHOP node
Screen->>Encounter: Start encounter for node
Encounter->>State: Apply outcome or transaction
Encounter-->>Screen: Complete once
Screen-->>Map: Return with updated run state
Acceptance criteria
- An
EVENTnode launches a Chance encounter and aSHOPnode launches a Shop encounter. - Encounter completion returns to the same map run and updates node progression exactly once.
- Chance outcomes update the final Player state without partial changes.
- Successful Shop purchases update money, deck and stock together.
- Failed purchases leave money, deck, stock and map progression unchanged.
- Duplicate or stale completion callbacks do not repeat rewards, charges, cards, stock changes or node completion.
- Chance and Shop UI provide clear choice, purchase, failure, leave and return feedback.
Test environment
- Feature branch:
Feature-2-Sprint2 - Final integration target:
main - Final merge PR: PR #232
- Final merge commit:
07b87be9de6b900f92fd5c72c07949434900865e - Merged to
main: 15 September 2026 - Java: JDK 21
- Final integration verification command:
./gradlew -g C:/gradle-cache test spotlessCheck
Manual acceptance tests
M1 EVENT node to Chance encounter to Map
- Start a new run and select an available
EVENTnode. - Confirm that the Chance UI opens for the selected node.
- Select one valid choice and continue.
- Confirm that the result is shown and the game returns to the same map.
- Confirm that the selected node is completed and only valid successor nodes become available.
Expected result: The real Chance encounter opens, one outcome is applied, the same run state is retained and map progression advances once.
M2 SHOP node to purchase or leave to Map
- Select an available
SHOPnode. - Confirm that the Shop UI displays real card data, price and stock.
- Purchase an affordable card.
- Confirm that money decreases once, the card is added once and stock decreases once.
- Leave the Shop and confirm that the game returns to the same map.
Expected result: The transaction is atomic, the updated deck persists and the Shop node completes once.
M3 Chance outcome mapping
- Run Chance encounters that produce health, money, card and no-effect outcomes.
- Record Player state before and after each choice.
- Repeat a boundary case where health or money would reach a limit.
Expected result: Each outcome changes only its intended state, respects bounds and is reported once.
M4 Duplicate completion protection
- Complete a Chance or Shop encounter.
- Trigger the Continue or Leave action again before the screen transition finishes, if possible.
- Inspect Player, deck, stock and map state.
Expected result: Only the first completion reaches the map. Rewards, charges, cards, stock changes and node completion are not repeated.
M5 Failed purchase atomicity and failure progression
- Enter a Shop with insufficient money for a visible item.
- Record money, deck size, item stock and current map node.
- Attempt the purchase.
- Confirm that a clear failure message is shown.
- Leave or complete the encounter through the agreed failure path.
Expected result: Money, deck and stock remain unchanged; failure does not unlock a new map node; no partial state remains.
Execution record
Do not mark a row as manual PASS unless the scenario was run against the final integrated build and evidence was retained.
| ID | Current status | Recorded result | Evidence |
|---|---|---|---|
| M1 | Team manual PASS | Map → EVENT → Chance → Map was manually verified. The same run and map were retained and node progression continued correctly. | PR #213 integration verification |
| M2 | Team manual PASS | Map → SHOP → Shop → Map was manually verified. The player could return to the same map and continue selecting valid nodes. | PR #213 integration verification |
| M3 | Partial manual PASS | Health and currency outcomes were manually verified. Card and no-effect outcomes do not yet have a complete retained manual record. | Existing Team 2 manual verification record |
| M4 | Automated PASS; manual evidence pending | Exactly-once completion and stale or duplicate callback protection are covered by the acceptance regression and controller tests. | PR #229 acceptance regressions |
| M5 | Automated PASS; manual UI evidence pending | A failed purchase leaves money, deck and stock unchanged and does not advance map progression. | PR #229 acceptance regressions |
Automated regression coverage
The acceptance regression test uses the production CardLibrary, PlayerDeck, CombatStatsComponent, InventoryComponent, MapGraph and ShopService integration components.
| Regression | Invariant |
|---|---|
| Chance and Shop round trip | Health, money, deck, stock and map state update once; stale completion is ignored. |
| Failed Shop purchase | Money, deck and stock remain unchanged; the current map node remains current and its successor remains locked. |
Evidence:
- PR #213 — EVENT and SHOP map integration
- PR #216 — shared persistent player state
- PR #229 — acceptance regression tests
- PR #232 — final Team 2 Sprint 2 merge
- PR #237 — lethal Chance outcome lifecycle fix
The acceptance regression tests are present in the final merged repository. They cover the production Chance and Shop round trip, duplicate or stale completion protection, failed-purchase atomicity and map progression invariants.
The overall fork workflow on PR #184 is red only because the fork cannot access the repository Discord webhook secret. The test execution and Java formatting steps passed. The regression test must be re-published from an upstream task/* branch and re-run on the latest feature commit before merge.
Known limitations and remaining sign-off
- The Team 2 Sprint 2 feature was merged into
mainthrough PR #232. - The final merge commit is
07b87be9de6b900f92fd5c72c07949434900865e. - M3 card and no-effect outcomes do not yet have complete retained manual evidence.
- M4 duplicate UI action behaviour and M5 failure-message presentation do not yet have retained screenshots or recordings.
- These remaining manual evidence limitations do not remove the automated regression coverage for lifecycle completion, failed-purchase atomicity and map progression.