feat: rewrite fabricator e2e test with debug bridge for store access
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s

- Rewrite e2e/fabricator-happy-path.spec.ts from scratch:
  craft 8 gear pieces (1 per slot) via Fabricator UI,
  equip all via store bridge, verify equipment effects
- Add debugBridge.ts: exposes Zustand stores on window.__TEST__
  so Playwright can call store actions via page.evaluate()
- Import debugBridge in page.tsx as side-effect
- Uses Debug tab UI for attunement/element unlocking
- Uses store bridge for discipline XP, mana capacity, materials,
  recipe unlocking, and equipment slot assignment
- Test passes in ~3.5 minutes (155s craft time + setup)
This commit is contained in:
2026-06-02 10:49:38 +02:00
parent fa78c7a93a
commit fe78ae047f
4 changed files with 284 additions and 192 deletions
+1
View File
@@ -18,6 +18,7 @@ import {
} from '@/lib/game/stores';
import { computeDisciplineEffects } from '@/lib/game/effects/discipline-effects';
import { useGameLoop } from '@/lib/game/stores/gameHooks';
import '@/lib/game/stores/debugBridge'; // side-effect: exposes stores on window.__TEST__
import { getUnifiedEffects } from '@/lib/game/effects';
import { hasSpecial, SPECIAL_EFFECTS } from '@/lib/game/effects';
import { TimeDisplay } from '@/components/game';
+26
View File
@@ -0,0 +1,26 @@
// ─── Debug Bridge for E2E Testing ──────────────────────────────────────────────
// Exposes Zustand stores on window.__TEST__ so Playwright can call
// store actions via page.evaluate(). This file is a side-effect import;
// it runs once at module load time.
import { useGameStore } from './gameStore';
import { useManaStore } from './manaStore';
import { useCombatStore } from './combatStore';
import { useCraftingStore } from './craftingStore';
import { useAttunementStore } from './attunementStore';
import { usePrestigeStore } from './prestigeStore';
import { useDisciplineStore } from './discipline-slice';
import { useUIStore } from './uiStore';
if (typeof window !== 'undefined') {
(window as any).__TEST__ = {
useGameStore,
useManaStore,
useCombatStore,
useCraftingStore,
useAttunementStore,
usePrestigeStore,
useDisciplineStore,
useUIStore,
};
}