From e358595a5905807d97ec3607f1eceb94edbd5f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 24 Sep 2026 14:01:25 +0200 Subject: [PATCH] fix(ios-e2e): allow WebView runner recovery before alert probe --- .../ios-simulator-e2e/live-automation-scenario.ts | 7 ++++--- .../ios-simulator-e2e/live-webview-remote-content.ts | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/integration/ios-simulator-e2e/live-automation-scenario.ts b/test/integration/ios-simulator-e2e/live-automation-scenario.ts index dfe77d2eac..9c5c144837 100644 --- a/test/integration/ios-simulator-e2e/live-automation-scenario.ts +++ b/test/integration/ios-simulator-e2e/live-automation-scenario.ts @@ -261,17 +261,18 @@ async function assertClearStateLaunchUrl(context: LiveContext): Promise { * a shared landmark never matches off its route and sends every caller into the probe — and * `alert get` against a live WKWebView screen is the XCTest query that exceeds the runner's * execution watchdog, leaving every later command refused as `RUNNER_BUSY` (#2484 follow-up). The - * landmark must therefore be a native node the route renders before its content, and the budget - * above must outlast a cold mount, so the probe is reached only when something really is blocking. + * landmark must therefore be a native node the route renders before its content, and its wait + * budget must outlast a cold mount, so the probe is reached only when something really is blocking. */ export async function acceptDeepLinkConfirmationIfPresent( context: LiveContext, destination: readonly string[], + firstWaitMs = DEEP_LINK_DESTINATION_WAIT_MS, ): Promise { const arrived = await runStep( context, 'wait for deep-link destination before inspecting system UI', - ['wait', ...destination, DEEP_LINK_DESTINATION_WAIT_MS], + ['wait', ...destination, firstWaitMs], { allowFailure: true }, ); if (arrived.status === 0) return; diff --git a/test/integration/ios-simulator-e2e/live-webview-remote-content.ts b/test/integration/ios-simulator-e2e/live-webview-remote-content.ts index 711f4fab6f..306ffcc141 100644 --- a/test/integration/ios-simulator-e2e/live-webview-remote-content.ts +++ b/test/integration/ios-simulator-e2e/live-webview-remote-content.ts @@ -8,6 +8,9 @@ const WEBVIEW_LAB_DEEP_LINK = 'agent-device-test-app:///webview'; // Native chrome of the lab, rendered with the route and before the page: it proves the deep link // landed without asking the runner to query a screen whose web view is still loading. const LAB_CHROME_ID = 'close-webview-lab'; +// A bridge fallback can restart XCTest during this first capture; let that finish before probing +// for a system alert through the same runner. +const LAB_CHROME_WAIT_MS = '45000'; // The first WebContent process of the run spawns here; a cold CI simulator needs more than the // shared 10 s wait budget before the page's tree exists. const PAGE_LOAD_WAIT_MS = '20000'; @@ -35,7 +38,7 @@ export async function assertWebViewRemoteContent(context: LiveContext): Promise< '--launch-url', WEBVIEW_LAB_DEEP_LINK, ]); - await acceptDeepLinkConfirmationIfPresent(context, [`id="${LAB_CHROME_ID}"`]); + await acceptDeepLinkConfirmationIfPresent(context, [`id="${LAB_CHROME_ID}"`], LAB_CHROME_WAIT_MS); // `wait` observes through the same route as `snapshot`: page content is reachable only once the // route has stopped publishing the bridge's page-less tree. await runStep(context, 'wait for the WebView page to expose its link', [