Skip to content

Commit 234f5a0

Browse files
committed
test(ios): cover legacy snapshot presentation boundary
1 parent 5fd9466 commit 234f5a0

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

packages/provider-webdriver/src/webdriver-ios-snapshot.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,11 @@ export function acquireWebDriverIosSnapshot(
7777
lineage: targetId ? { targetId } : {},
7878
residue,
7979
};
80-
const acquisition: IosSnapshotAcquisition =
81-
request.acquisitionIntent === 'full'
82-
? { ...common, intent: 'full', hint: { ...plan.hint, acquisitionIntent: 'full' } }
83-
: {
84-
...common,
85-
intent: 'surface-observation',
86-
hint: { ...plan.hint, acquisitionIntent: 'surface-observation' },
87-
};
80+
const acquisition: IosSnapshotAcquisition = {
81+
...common,
82+
intent: 'full',
83+
hint: { ...plan.hint, acquisitionIntent: 'full' },
84+
};
8885
return { request, plan, input: { stage: 'acquired', acquisition } };
8986
}
9087

@@ -164,7 +161,7 @@ function warningForResidue(entry: IosAcquisitionResidue): string | undefined {
164161
if (entry.kind === 'unavailable-fact') {
165162
return entry.fact === 'hittability'
166163
? 'Appium page source does not provide hittability evidence; regular snapshot nodes are not actionable.'
167-
: `Appium page source does not provide ${entry.fact} evidence.`;
164+
: undefined;
168165
}
169166
if (entry.kind === 'missing-viewport' || entry.kind === 'truncated') {
170167
return RESIDUE_WARNINGS[entry.kind];

src/daemon/__tests__/snapshot-presentation-transitions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { navigationTitleWithAppProvidedDetailsAffordanceNodes } from '../../snap
88
test('iOS daemon presentation applies transitions without reapplying runner-owned scope', () => {
99
const snapshot = buildSnapshotState(
1010
{
11-
nodes: presentIosInteractiveSnapshot(navigationTitleWithAppProvidedDetailsAffordanceNodes),
11+
nodes: navigationTitleWithAppProvidedDetailsAffordanceNodes,
1212
backend: 'xctest',
1313
},
1414
{ snapshotInteractiveOnly: true, snapshotScope: 'DisplayNameTextField' },

src/daemon/__tests__/snapshot-publication-membership.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { expect, test } from 'vitest';
22
import type { RawSnapshotNode } from '@agent-device/kernel/snapshot';
3-
import { presentIosInteractiveSnapshot } from '@agent-device/capture-kit/ios-snapshot-engine';
43
import { buildSnapshotState } from '../../core/snapshot-state.ts';
54

65
// End-to-end publication-membership contract for the acquire/present design (#1797, external
@@ -12,10 +11,7 @@ import { buildSnapshotState } from '../../core/snapshot-state.ts';
1211
// suppression test below fails because promo-banner is published. It passes only when the
1312
// production suppression fires.
1413
function publish(nodes: RawSnapshotNode[]) {
15-
return buildSnapshotState(
16-
{ nodes: presentIosInteractiveSnapshot(nodes), backend: 'xctest' },
17-
{ snapshotInteractiveOnly: true },
18-
).nodes;
14+
return buildSnapshotState({ nodes, backend: 'xctest' }, { snapshotInteractiveOnly: true }).nodes;
1915
}
2016

2117
const screen: RawSnapshotNode[] = [

0 commit comments

Comments
 (0)