fix: improve combat-happy-path e2e test reliability and speed
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m24s
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:
@@ -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();
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user