fix: update e2e tests for localhost and current game architecture
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m20s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m20s
- playwright.config.ts: change baseURL from dev site to localhost:3000 - combat-happy-path.spec.ts: fix climb button location (LeftPanel, not spire tab), fix descent via store, handle game-over from day overflow, reduce tick counts to avoid day 30 limit - fabricator-happy-path.spec.ts: set currentAction to meditate before crafting (required by startFabricatorCrafting) - playtest.spec.ts: rewrite from scratch — use localhost, window.__TEST__ bridge (not window.__debug), current tab names (no grimoire/element tabs), split into 3 files under 400-line limit - playtest-basic-ui.spec.ts: sections 1-3 (basic UI, stats, spire) - playtest-tabs.spec.ts: sections 4-11 (all tab navigation tests) - playtest-debug.spec.ts: sections 12-14 (debug tab, bridge, stress test)
This commit is contained in:
@@ -193,6 +193,11 @@ test.describe('Fabricator Happy-Path: Craft → Equip → Verify Stats', () => {
|
||||
|
||||
// Recipes are now unlocked via discipline perks (study-fabricator-recipes at 1000 XP)
|
||||
|
||||
// Set current action to 'meditate' so fabricator crafting can start
|
||||
await page.evaluate(() => {
|
||||
(window as any).__TEST__.useCombatStore.setState({ currentAction: 'meditate' });
|
||||
});
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════
|
||||
// STEP 3: Craft each piece of gear sequentially
|
||||
// ══════════════════════════════════════════════════════════════════════════
|
||||
@@ -224,12 +229,18 @@ test.describe('Fabricator Happy-Path: Craft → Equip → Verify Stats', () => {
|
||||
const recipeCard = recipeName.locator('xpath=ancestor::div[contains(@class, "p-3")]').first();
|
||||
const craftBtn = recipeCard.locator('button', { hasText: /^Craft$/i }).first();
|
||||
await expect(craftBtn).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Check if button is disabled
|
||||
const btnDisabled = await craftBtn.isDisabled();
|
||||
const btnText = await craftBtn.textContent();
|
||||
console.log(`[TEST] Craft button for ${gear.name}: disabled=${btnDisabled}, text="${btnText}"`);
|
||||
|
||||
await craftBtn.click();
|
||||
await waitForMs(page, 500);
|
||||
|
||||
// Run enough ticks to complete this craft.
|
||||
// craftTime(h) / HOURS_PER_TICK(0.04) ticks needed, plus a small buffer.
|
||||
const craftTicks = ticksForHours(gear.time) + 10;
|
||||
// craftTime(h) / HOURS_PER_TICK(0.04) ticks needed, plus a buffer.
|
||||
const craftTicks = ticksForHours(gear.time) + 50;
|
||||
console.log(`[TEST] Running ${craftTicks} ticks to craft ${gear.name}...`);
|
||||
await runTicks(page, craftTicks);
|
||||
await waitForMs(page, 500); // let React re-render
|
||||
|
||||
Reference in New Issue
Block a user