Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,18 @@ async function assertClearStateLaunchUrl(context: LiveContext): Promise<void> {
* 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<void> {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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', [
Expand Down
Loading