diff --git a/tests/e2e/07-conversion-funnel.spec.ts b/tests/e2e/07-conversion-funnel.spec.ts index dcd6e3f..53c1c16 100644 --- a/tests/e2e/07-conversion-funnel.spec.ts +++ b/tests/e2e/07-conversion-funnel.spec.ts @@ -296,8 +296,24 @@ test.describe('Conversion Funnel: Landing → Swap → Stake', () => { const hasLocalSwap = await localSwapWidget.isVisible({ timeout: 5_000 }).catch(() => false); if (hasLocalSwap) { - console.log('[DEEPLINK] Local swap mode — verifying swap widget is functional'); - // With wallet context, the swap input and buy button should be visible + console.log('[DEEPLINK] Local swap mode — connecting wallet first'); + // The wallet must be explicitly connected for the swap input to render. + // Navigate to main page to access the connect button, then return. + const navbarTitle = page.locator('.navbar-title').first(); + await navbarTitle.waitFor({ state: 'visible', timeout: 30_000 }); + await page.evaluate(() => window.dispatchEvent(new Event('resize'))); + const connectBtn = page.locator('.connect-button--disconnected').first(); + if (await connectBtn.isVisible({ timeout: 10_000 }).catch(() => false)) { + await connectBtn.click(); + const connector = page.locator('.connectors-element').first(); + await connector.waitFor({ state: 'visible', timeout: 10_000 }); + await connector.click(); + // Wait for wallet to connect + await page.getByText(/0x[a-fA-F0-9]{4}/i).first().waitFor({ state: 'visible', timeout: 15_000 }); + console.log('[DEEPLINK] Wallet connected'); + } + console.log('[DEEPLINK] Verifying swap widget is functional'); + // With wallet connected, the swap input and buy button should be visible await expect(page.locator('[data-testid="swap-amount-input"]')).toBeVisible({ timeout: 5_000 }); await expect(page.getByTestId('swap-buy-button')).toBeVisible(); console.log('[DEEPLINK] ✅ Local swap widget verified');