diff --git a/tests/e2e/07-conversion-funnel.spec.ts b/tests/e2e/07-conversion-funnel.spec.ts index 92f538b..8322fe8 100644 --- a/tests/e2e/07-conversion-funnel.spec.ts +++ b/tests/e2e/07-conversion-funnel.spec.ts @@ -33,6 +33,9 @@ async function getAnalyticsEvents(page: Page): Promise { + // Cap per-test timeout to 3 minutes — funnel tests are navigation-only, no transactions. + test.describe.configure({ timeout: 3 * 60 * 1000 }); + test.beforeAll(async () => { await validateStackHealthy(STACK_CONFIG); }); @@ -63,11 +66,12 @@ test.describe('Conversion Funnel: Landing → Swap → Stake', () => { // ── Step 2: Click CTA → navigates to /app/get-krk ── console.log('[FUNNEL] Clicking hero "Get $KRK" CTA...'); - await heroCta.click(); - - // The landing CTA sets window.location.href for /app/* paths, triggering - // a full-page navigation through Caddy to the webapp service. - await page.waitForURL('**/app/get-krk**', { timeout: 30_000 }); + // Use Promise.all to avoid race: the click triggers window.location.href + // which starts a full-page navigation through Caddy to the webapp. + await Promise.all([ + page.waitForURL('**/app/get-krk**', { timeout: 30_000 }), + heroCta.click(), + ]); console.log('[FUNNEL] Navigated to web-app get-krk page'); // Verify the Get KRK page rendered @@ -173,9 +177,10 @@ test.describe('Conversion Funnel: Landing → Swap → Stake', () => { const heroCta = page.locator('.header-cta button, .header-cta .k-button').first(); await expect(heroCta).toBeVisible({ timeout: 15_000 }); console.log('[FUNNEL-MOBILE] Clicking hero CTA...'); - await heroCta.click(); - - await page.waitForURL('**/app/get-krk**', { timeout: 30_000 }); + await Promise.all([ + page.waitForURL('**/app/get-krk**', { timeout: 30_000 }), + heroCta.click(), + ]); console.log('[FUNNEL-MOBILE] Navigated to get-krk page'); const getKrkHeading = page.getByRole('heading', { name: 'Get $KRK Tokens' });