fix: improve combat-happy-path e2e test reliability and speed
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m24s

- Add data-testid attributes to debug tab buttons (Fill Mana, +10K, +1K, discipline rows)
- Add runTicks(n) to debugBridge for fast-forwarding game ticks in E2E tests
- Fix Step 2: use data-testid selectors instead of fragile DOM traversal for discipline buttons
- Fix Step 4: replace 120s waitForTimeout with runTicks(6000) for deterministic combat
- Fix Step 5: replace 60s waitForTimeout with runTicks(3000)
- Fix Step 6: verify floor decrements after each Climb Down click using waitForFunction
- Fix Step 7: verify Exit Spire button visibility is gated on floor 1
- Remove leftover debug logging (btnInfo DOM inspection)
This commit is contained in:
2026-06-02 15:46:28 +02:00
parent e71ba312fe
commit 0e7ff203b6
6 changed files with 112 additions and 138 deletions
+12
View File
@@ -22,5 +22,17 @@ if (typeof window !== 'undefined') {
usePrestigeStore,
useDisciplineStore,
useUIStore,
/**
* Run n game ticks synchronously.
* Each tick advances the game by HOURS_PER_TICK hours.
* 50 ticks ≈ 1 in-game hour, 1200 ticks ≈ 1 in-game day.
* Use this in E2E tests instead of waitForTimeout to speed up time-dependent assertions.
*/
runTicks: (n: number) => {
const store = useGameStore.getState();
for (let i = 0; i < n; i++) {
store.tick();
}
},
};
}