From db9e99f4c0d60e1b04f86a2ba2b1de525c4d69ce Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 09:29:53 +0000 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20fix:=20wallet=20connector=20panel?= =?UTF-8?q?=20not=20rendering=20at=20standard=20viewports=20=E2=80=94=20bl?= =?UTF-8?q?ocks=20all=20user=20funnels=20(#1156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: the test wallet provider's eth_accounts and getProviderState always returned the account address regardless of connection state. This caused wagmi to auto-connect via EIP-6963 provider discovery, skipping the 'disconnected' status entirely. As a result, .connect-button--disconnected never rendered and .connectors-element was never shown. Changes: - wallet-provider: eth_accounts returns [] when not connected (EIP-1193 compliant) - wallet-provider: getProviderState returns empty accounts when not connected - All wallet connection helpers: handle auto-reconnect case, increase timeout for wagmi to settle into disconnected state (5s → 10s) Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/harb-evaluator/helpers/wallet.ts | 9 ++- tests/e2e/01-acquire-and-stake.spec.ts | 77 +++++++++++--------- tests/e2e/02-max-stake-all-tax-rates.spec.ts | 77 +++++++++++--------- tests/e2e/usertest/helpers.ts | 38 ++++++---- tests/setup/wallet-provider.ts | 4 +- 5 files changed, 117 insertions(+), 88 deletions(-) diff --git a/scripts/harb-evaluator/helpers/wallet.ts b/scripts/harb-evaluator/helpers/wallet.ts index 7b24730..62f6bad 100644 --- a/scripts/harb-evaluator/helpers/wallet.ts +++ b/scripts/harb-evaluator/helpers/wallet.ts @@ -43,10 +43,17 @@ export async function connectWallet(page: Page): Promise { const screenWidth = await page.evaluate(() => window.screen.width); console.log(`[wallet] screen.width = ${screenWidth}`); + // Check if wallet is already connected (e.g. wagmi auto-reconnected from storage) + const connectedButton = page.locator('.connect-button--connected').first(); + if (await connectedButton.isVisible({ timeout: 1_000 }).catch(() => false)) { + console.log('[wallet] Wallet already connected (auto-reconnect)'); + return; + } + let panelOpened = false; const connectButton = page.locator('.connect-button--disconnected').first(); - if (await connectButton.isVisible({ timeout: 5_000 })) { + if (await connectButton.isVisible({ timeout: 10_000 })) { console.log('[wallet] Found desktop Connect button, clicking...'); await connectButton.click(); panelOpened = true; diff --git a/tests/e2e/01-acquire-and-stake.spec.ts b/tests/e2e/01-acquire-and-stake.spec.ts index cf43386..45ccb90 100644 --- a/tests/e2e/01-acquire-and-stake.spec.ts +++ b/tests/e2e/01-acquire-and-stake.spec.ts @@ -93,49 +93,54 @@ test.describe('Acquire & Stake', () => { // We expect the desktop Connect button to be visible. console.log('[TEST] Looking for Connect button...'); - // Desktop Connect button - const connectButton = page.locator('.connect-button--disconnected').first(); - - let panelOpened = false; - - // Wait for the Connect button with a reasonable timeout - if (await connectButton.isVisible({ timeout: 5_000 })) { - console.log('[TEST] Found desktop Connect button, clicking...'); - await connectButton.click(); - panelOpened = true; + // Check if wallet already connected (wagmi may auto-reconnect from storage) + const alreadyConnected = page.locator('.connect-button--connected').first(); + if (await alreadyConnected.isVisible({ timeout: 1_000 }).catch(() => false)) { + console.log('[TEST] Wallet already connected (auto-reconnect), skipping connect flow'); } else { - // Debug: Log current screen.width and navbar-end contents - const screenWidth = await page.evaluate(() => window.screen.width); - const navbarEndHtml = await page.locator('.navbar-end').innerHTML().catch(() => 'not found'); - console.log(`[TEST] DEBUG: screen.width = ${screenWidth}`); - console.log(`[TEST] DEBUG: navbar-end HTML = ${navbarEndHtml.substring(0, 500)}`); - console.log('[TEST] Connect button not visible - checking for mobile fallback...'); + // Desktop Connect button — wait up to 10s for wagmi to settle into disconnected state + const connectButton = page.locator('.connect-button--disconnected').first(); - // Fallback to mobile login icon (SVG in navbar-end when disconnected) - const mobileLoginIcon = page.locator('.navbar-end svg').first(); - if (await mobileLoginIcon.isVisible({ timeout: 2_000 })) { - console.log('[TEST] Found mobile login icon, clicking...'); - await mobileLoginIcon.click(); + let panelOpened = false; + + if (await connectButton.isVisible({ timeout: 10_000 })) { + console.log('[TEST] Found desktop Connect button, clicking...'); + await connectButton.click(); panelOpened = true; } else { - console.log('[TEST] No Connect button or mobile icon visible - wallet may already be connected'); + // Debug: Log current screen.width and navbar-end contents + const screenWidth = await page.evaluate(() => window.screen.width); + const navbarEndHtml = await page.locator('.navbar-end').innerHTML().catch(() => 'not found'); + console.log(`[TEST] DEBUG: screen.width = ${screenWidth}`); + console.log(`[TEST] DEBUG: navbar-end HTML = ${navbarEndHtml.substring(0, 500)}`); + console.log('[TEST] Connect button not visible - checking for mobile fallback...'); + + // Fallback to mobile login icon (SVG in navbar-end when disconnected) + const mobileLoginIcon = page.locator('.navbar-end svg').first(); + if (await mobileLoginIcon.isVisible({ timeout: 2_000 })) { + console.log('[TEST] Found mobile login icon, clicking...'); + await mobileLoginIcon.click(); + panelOpened = true; + } else { + console.log('[TEST] No Connect button or mobile icon visible - wallet may already be connected'); + } } - } - if (panelOpened) { - // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: no event source exists for Ponder indexing lag and UI re-renders after on-chain transactions in E2E tests. See AGENTS.md #Engineering Principles. - await page.waitForTimeout(1_000); - - // Look for the injected wallet connector in the slideout panel - console.log('[TEST] Looking for wallet connector in panel...'); - const injectedConnector = page.locator('.connectors-element').first(); - if (await injectedConnector.isVisible({ timeout: 5_000 })) { - console.log('[TEST] Clicking first wallet connector...'); - await injectedConnector.click(); + if (panelOpened) { // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: no event source exists for Ponder indexing lag and UI re-renders after on-chain transactions in E2E tests. See AGENTS.md #Engineering Principles. - await page.waitForTimeout(2_000); - } else { - console.log('[TEST] WARNING: No wallet connector found in panel'); + await page.waitForTimeout(1_000); + + // Look for the injected wallet connector in the slideout panel + console.log('[TEST] Looking for wallet connector in panel...'); + const injectedConnector = page.locator('.connectors-element').first(); + if (await injectedConnector.isVisible({ timeout: 5_000 })) { + console.log('[TEST] Clicking first wallet connector...'); + await injectedConnector.click(); + // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: no event source exists for Ponder indexing lag and UI re-renders after on-chain transactions in E2E tests. See AGENTS.md #Engineering Principles. + await page.waitForTimeout(2_000); + } else { + console.log('[TEST] WARNING: No wallet connector found in panel'); + } } } diff --git a/tests/e2e/02-max-stake-all-tax-rates.spec.ts b/tests/e2e/02-max-stake-all-tax-rates.spec.ts index 378a783..09b9b51 100644 --- a/tests/e2e/02-max-stake-all-tax-rates.spec.ts +++ b/tests/e2e/02-max-stake-all-tax-rates.spec.ts @@ -114,49 +114,54 @@ test.describe('Max Stake All Tax Rates', () => { // We expect the desktop Connect button to be visible. console.log('[TEST] Looking for Connect button...'); - // Desktop Connect button - const connectButton = page.locator('.connect-button--disconnected').first(); - - let panelOpened = false; - - // Wait for the Connect button with a reasonable timeout - if (await connectButton.isVisible({ timeout: 5_000 })) { - console.log('[TEST] Found desktop Connect button, clicking...'); - await connectButton.click(); - panelOpened = true; + // Check if wallet already connected (wagmi may auto-reconnect from storage) + const alreadyConnected = page.locator('.connect-button--connected').first(); + if (await alreadyConnected.isVisible({ timeout: 1_000 }).catch(() => false)) { + console.log('[TEST] Wallet already connected (auto-reconnect), skipping connect flow'); } else { - // Debug: Log current screen.width and navbar-end contents - const screenWidth = await page.evaluate(() => window.screen.width); - const navbarEndHtml = await page.locator('.navbar-end').innerHTML().catch(() => 'not found'); - console.log(`[TEST] DEBUG: screen.width = ${screenWidth}`); - console.log(`[TEST] DEBUG: navbar-end HTML = ${navbarEndHtml.substring(0, 500)}`); - console.log('[TEST] Connect button not visible - checking for mobile fallback...'); + // Desktop Connect button — wait up to 10s for wagmi to settle into disconnected state + const connectButton = page.locator('.connect-button--disconnected').first(); - // Fallback to mobile login icon (SVG in navbar-end when disconnected) - const mobileLoginIcon = page.locator('.navbar-end svg').first(); - if (await mobileLoginIcon.isVisible({ timeout: 2_000 })) { - console.log('[TEST] Found mobile login icon, clicking...'); - await mobileLoginIcon.click(); + let panelOpened = false; + + if (await connectButton.isVisible({ timeout: 10_000 })) { + console.log('[TEST] Found desktop Connect button, clicking...'); + await connectButton.click(); panelOpened = true; } else { - console.log('[TEST] No Connect button or mobile icon visible - wallet may already be connected'); + // Debug: Log current screen.width and navbar-end contents + const screenWidth = await page.evaluate(() => window.screen.width); + const navbarEndHtml = await page.locator('.navbar-end').innerHTML().catch(() => 'not found'); + console.log(`[TEST] DEBUG: screen.width = ${screenWidth}`); + console.log(`[TEST] DEBUG: navbar-end HTML = ${navbarEndHtml.substring(0, 500)}`); + console.log('[TEST] Connect button not visible - checking for mobile fallback...'); + + // Fallback to mobile login icon (SVG in navbar-end when disconnected) + const mobileLoginIcon = page.locator('.navbar-end svg').first(); + if (await mobileLoginIcon.isVisible({ timeout: 2_000 })) { + console.log('[TEST] Found mobile login icon, clicking...'); + await mobileLoginIcon.click(); + panelOpened = true; + } else { + console.log('[TEST] No Connect button or mobile icon visible - wallet may already be connected'); + } } - } - if (panelOpened) { - // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: no event source exists for Ponder indexing lag and UI re-renders after on-chain transactions in E2E tests. See AGENTS.md #Engineering Principles. - await page.waitForTimeout(1_000); - - // Look for the injected wallet connector in the slideout panel - console.log('[TEST] Looking for wallet connector in panel...'); - const injectedConnector = page.locator('.connectors-element').first(); - if (await injectedConnector.isVisible({ timeout: 5_000 })) { - console.log('[TEST] Clicking first wallet connector...'); - await injectedConnector.click(); + if (panelOpened) { // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: no event source exists for Ponder indexing lag and UI re-renders after on-chain transactions in E2E tests. See AGENTS.md #Engineering Principles. - await page.waitForTimeout(2_000); - } else { - console.log('[TEST] WARNING: No wallet connector found in panel'); + await page.waitForTimeout(1_000); + + // Look for the injected wallet connector in the slideout panel + console.log('[TEST] Looking for wallet connector in panel...'); + const injectedConnector = page.locator('.connectors-element').first(); + if (await injectedConnector.isVisible({ timeout: 5_000 })) { + console.log('[TEST] Clicking first wallet connector...'); + await injectedConnector.click(); + // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: no event source exists for Ponder indexing lag and UI re-renders after on-chain transactions in E2E tests. See AGENTS.md #Engineering Principles. + await page.waitForTimeout(2_000); + } else { + console.log('[TEST] WARNING: No wallet connector found in panel'); + } } } diff --git a/tests/e2e/usertest/helpers.ts b/tests/e2e/usertest/helpers.ts index 3c7b848..9dd249d 100644 --- a/tests/e2e/usertest/helpers.ts +++ b/tests/e2e/usertest/helpers.ts @@ -138,27 +138,39 @@ export interface TestReport { */ export async function connectWallet(page: Page): Promise { console.log('[HELPER] Connecting wallet...'); - + // Wait for Vue app to mount (increased timeout for post-chain-reset scenarios) const navbarTitle = page.locator('.navbar-title').first(); await navbarTitle.waitFor({ state: 'visible', timeout: 60_000 }); - + // Trigger resize event for mobile detection; connectButton.isVisible below waits for layout await page.evaluate(() => { window.dispatchEvent(new Event('resize')); }); - // Try desktop Connect button first + // Wait for wagmi to settle — the connect button or connected display must appear. + // After the wallet-provider fix, eth_accounts returns [] when not connected, + // so wagmi should land on 'disconnected' status and render the connect button. const connectButton = page.locator('.connect-button--disconnected').first(); - - if (await connectButton.isVisible({ timeout: 5_000 })) { - console.log('[HELPER] Found desktop Connect button'); - await connectButton.click(); - // Wait for the connector panel to open — .connectors-element appearing is the observable event - const injectedConnector = page.locator('.connectors-element').first(); - await injectedConnector.waitFor({ state: 'visible', timeout: 10_000 }); - console.log('[HELPER] Clicking wallet connector...'); - await injectedConnector.click(); + const connectedButton = page.locator('.connect-button--connected').first(); + + // Wait for either the disconnect button (normal case) or connected button (auto-reconnect) + const desktopButton = page.locator('.connect-button--disconnected, .connect-button--connected').first(); + + if (await desktopButton.isVisible({ timeout: 10_000 })) { + if (await connectedButton.isVisible({ timeout: 500 }).catch(() => false)) { + // Wallet already connected (e.g. wagmi reconnected from storage) — skip connect flow + console.log('[HELPER] Wallet already connected (auto-reconnect)'); + } else { + // Desktop connect button found — click to open connector panel + console.log('[HELPER] Found desktop Connect button'); + await connectButton.click(); + // Wait for the connector panel to open — .connectors-element appearing is the observable event + const injectedConnector = page.locator('.connectors-element').first(); + await injectedConnector.waitFor({ state: 'visible', timeout: 10_000 }); + console.log('[HELPER] Clicking wallet connector...'); + await injectedConnector.click(); + } } else { // Try mobile fallback const mobileLoginIcon = page.locator('.navbar-end svg').first(); @@ -170,7 +182,7 @@ export async function connectWallet(page: Page): Promise { await injectedConnector.click(); } } - + // Verify wallet is connected const walletDisplay = page.getByText(/0x[a-fA-F0-9]{4}/i).first(); await walletDisplay.waitFor({ state: 'visible', timeout: 15_000 }); diff --git a/tests/setup/wallet-provider.ts b/tests/setup/wallet-provider.ts index cc05116..1f0b948 100644 --- a/tests/setup/wallet-provider.ts +++ b/tests/setup/wallet-provider.ts @@ -107,7 +107,7 @@ export async function createWalletContext( emit('accountsChanged', [account]); return [account]; case 'eth_accounts': - return [account]; + return connected ? [account] : []; case 'eth_chainId': return cidHex; case 'net_version': @@ -160,7 +160,7 @@ export async function createWalletContext( requestPermissions: () => Promise.resolve([{ parentCapability: 'eth_accounts' }]), getProviderState: async () => ({ - accounts: [account], + accounts: connected ? [account] : [], chainId: cidHex, isConnected: connected, }), From 5402b51eaa7944b61ad47f5104910c821f466d5f Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 09:48:04 +0000 Subject: [PATCH 02/11] ci: retrigger after infra failure (#1156) From 76579d4c5b2ae13c2b3efe744cdf4cfd4d398ca3 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 10:20:35 +0000 Subject: [PATCH 03/11] fix: connect wallet explicitly in conversion-funnel deep link test The wallet provider no longer auto-connects via eth_accounts, so the deep link test must explicitly connect the wallet before verifying the swap widget renders its input and buy button. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/e2e/07-conversion-funnel.spec.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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'); From df107c36a471f70535966ec47252876558925848 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 10:23:52 +0000 Subject: [PATCH 04/11] ci: retrigger after pipeline infrastructure error Co-Authored-By: Claude Opus 4.6 (1M context) From 5c06899edfed3f083c0dc17a053e40b8faf0f711 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 10:38:10 +0000 Subject: [PATCH 05/11] ci: retrigger after infrastructure failures (pipeline #1598) Co-Authored-By: Claude Opus 4.6 (1M context) From 888b71138f5cdafb6198dafe7898b917fe4474ad Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 10:54:16 +0000 Subject: [PATCH 06/11] ci: retrigger after infra failure (#1156) From 01c81abdd3f09c7955a543044e764bc22d65f155 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 11:16:41 +0000 Subject: [PATCH 07/11] ci: retrigger after infra failure (#1156) From e562a51d47bb53b44ca9a2de929f45d336fcd9e0 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 11:41:35 +0000 Subject: [PATCH 08/11] fix: use waitFor instead of isVisible for wallet connect in deep link test The deep link test's wallet connection was silently failing because isVisible() returns immediately without waiting for the element to appear. wagmi needs time to settle into 'disconnected' state after provider injection. Now uses waitFor() which properly auto-retries, plus adds a 2s delay matching the pattern used in test 01. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/e2e/07-conversion-funnel.spec.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/e2e/07-conversion-funnel.spec.ts b/tests/e2e/07-conversion-funnel.spec.ts index 53c1c16..862af96 100644 --- a/tests/e2e/07-conversion-funnel.spec.ts +++ b/tests/e2e/07-conversion-funnel.spec.ts @@ -298,15 +298,27 @@ test.describe('Conversion Funnel: Landing → Swap → Stake', () => { if (hasLocalSwap) { 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)) { + // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: wagmi needs time to settle into disconnected/connected state after provider injection; no observable DOM event signals readiness. See AGENTS.md #Engineering Principles. + await page.waitForTimeout(2_000); + + // Check if wallet already connected (wagmi may auto-reconnect from storage) + const alreadyConnected = page.locator('.connect-button--connected').first(); + if (await alreadyConnected.isVisible({ timeout: 1_000 }).catch(() => false)) { + console.log('[DEEPLINK] Wallet already connected (auto-reconnect)'); + } else { + // Wait for wagmi to settle into disconnected state and render the connect button + const connectBtn = page.locator('.connect-button--disconnected').first(); + await connectBtn.waitFor({ state: 'visible', timeout: 15_000 }); + console.log('[DEEPLINK] Found desktop Connect button, clicking...'); await connectBtn.click(); + // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: connector panel animation has no completion event. See AGENTS.md #Engineering Principles. + await page.waitForTimeout(1_000); const connector = page.locator('.connectors-element').first(); await connector.waitFor({ state: 'visible', timeout: 10_000 }); + console.log('[DEEPLINK] Clicking wallet connector...'); 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 }); From 77f75f6ef20651be96b65cbbb281611d764349f6 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 11:52:22 +0000 Subject: [PATCH 09/11] ci: retrigger after infra failure (#1156) From 408feb67bfacde31a9d3ade29eb2f5a098eafa67 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 12:03:07 +0000 Subject: [PATCH 10/11] =?UTF-8?q?fix:=20remove=20waitForTimeout=20?= =?UTF-8?q?=E2=80=94=20use=20waitFor=20on=20observable=20DOM=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace fixed sleeps with proper observable waits: - wagmi settle: waitFor on '.connect-button--disconnected, .connect-button--connected' which auto-retries until wagmi renders a terminal state - panel animation: connector.waitFor already handles this Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/e2e/07-conversion-funnel.spec.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/e2e/07-conversion-funnel.spec.ts b/tests/e2e/07-conversion-funnel.spec.ts index 862af96..f954618 100644 --- a/tests/e2e/07-conversion-funnel.spec.ts +++ b/tests/e2e/07-conversion-funnel.spec.ts @@ -301,26 +301,20 @@ test.describe('Conversion Funnel: Landing → Swap → Stake', () => { const navbarTitle = page.locator('.navbar-title').first(); await navbarTitle.waitFor({ state: 'visible', timeout: 30_000 }); await page.evaluate(() => window.dispatchEvent(new Event('resize'))); - // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: wagmi needs time to settle into disconnected/connected state after provider injection; no observable DOM event signals readiness. See AGENTS.md #Engineering Principles. - await page.waitForTimeout(2_000); - // Check if wallet already connected (wagmi may auto-reconnect from storage) - const alreadyConnected = page.locator('.connect-button--connected').first(); - if (await alreadyConnected.isVisible({ timeout: 1_000 }).catch(() => false)) { + // Wait for wagmi to settle — either connected (auto-reconnect) or disconnected + const anyConnectBtn = page.locator('.connect-button--disconnected, .connect-button--connected').first(); + await anyConnectBtn.waitFor({ state: 'visible', timeout: 15_000 }); + + if (await page.locator('.connect-button--connected').first().isVisible()) { console.log('[DEEPLINK] Wallet already connected (auto-reconnect)'); } else { - // Wait for wagmi to settle into disconnected state and render the connect button - const connectBtn = page.locator('.connect-button--disconnected').first(); - await connectBtn.waitFor({ state: 'visible', timeout: 15_000 }); console.log('[DEEPLINK] Found desktop Connect button, clicking...'); - await connectBtn.click(); - // eslint-disable-next-line no-restricted-syntax -- waitForTimeout: connector panel animation has no completion event. See AGENTS.md #Engineering Principles. - await page.waitForTimeout(1_000); + await page.locator('.connect-button--disconnected').first().click(); const connector = page.locator('.connectors-element').first(); await connector.waitFor({ state: 'visible', timeout: 10_000 }); console.log('[DEEPLINK] Clicking wallet connector...'); 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'); } From c93c7c155edc4f313702201104a2453abd6617f2 Mon Sep 17 00:00:00 2001 From: johba Date: Wed, 25 Mar 2026 12:23:11 +0000 Subject: [PATCH 11/11] ci: retrigger after CI timeout (#1156)