Skip to content

Commit cb7f1a6

Browse files
committed
test(ios-smoke): probe deep-link prompt after readiness exhaustion
1 parent 4bbbfb7 commit cb7f1a6

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

‎test/integration/ios-simulator-e2e-deep-link-confirmation.test.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ const READABLE_TIMEOUT = result(1, {
2828
details: { reason: WAIT_REASONS.deadlineExceeded, readableCaptures: 5, captureTruncated: true },
2929
},
3030
});
31+
const READINESS_TIMEOUT = result(1, {
32+
error: {
33+
code: 'COMMAND_FAILED',
34+
details: {
35+
reason: WAIT_REASONS.readinessExhausted,
36+
readinessPhase: 'target-discovery',
37+
readableCaptures: 0,
38+
},
39+
},
40+
});
3141
const OPEN_PROMPT = result(0, {
3242
data: { message: 'Open in “Agent Device Tester”?', items: ['Cancel', 'Open'] },
3343
});
@@ -79,6 +89,19 @@ test('a readable destination timeout still answers a real Open confirmation', as
7989
]);
8090
});
8191

92+
test('target discovery exhaustion still answers a deep-link confirmation', async () => {
93+
const { device, log } = simulator([READINESS_TIMEOUT, LANDED]);
94+
95+
await answerDeepLinkConfirmation(device);
96+
97+
assert.deepEqual(log, [
98+
'wait for the deep-link destination (1/5)',
99+
'alert get',
100+
'alert accept',
101+
'wait for the deep-link destination (2/5)',
102+
]);
103+
});
104+
82105
test('a readable no-match that answers Open waits for the released launch', async () => {
83106
const { device, log } = simulator([WRONG_ROUTE, LAUNCH_PENDING, LANDED]);
84107

‎test/integration/ios-simulator-e2e/live-deep-link-confirmation.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function acceptDeepLinkConfirmationIfPresent(
5454

5555
/**
5656
* A readable destination timeout can still leave the launch behind a system confirmation. Probe
57-
* once per miss until it is answered; a truncated or stalled capture then gets another bounded
57+
* once per miss until it is answered; interrupted readiness or capture then gets another bounded
5858
* wait, while a readable wrong-route miss without a prompt goes to the caller's assertion.
5959
*/
6060
export async function answerDeepLinkConfirmation(
@@ -71,9 +71,11 @@ export async function answerDeepLinkConfirmation(
7171
const reason = details?.reason;
7272
const readableMiss =
7373
reason === WAIT_REASONS.targetAbsent || reason === WAIT_REASONS.deadlineExceeded;
74-
const interruptedCapture =
75-
reason === WAIT_REASONS.captureStalled || reason === WAIT_REASONS.runnerRestartExhausted;
76-
if (!launchPending && !readableMiss && !interruptedCapture) return;
74+
const interruptedObservation =
75+
reason === WAIT_REASONS.captureStalled ||
76+
reason === WAIT_REASONS.readinessExhausted ||
77+
reason === WAIT_REASONS.runnerRestartExhausted;
78+
if (!launchPending && !readableMiss && !interruptedObservation) return;
7779
if (!answered) answered = await acceptOpenConfirmation(device);
7880
if (!answered && reason === WAIT_REASONS.targetAbsent) return;
7981
}

0 commit comments

Comments
 (0)