Skip to content

Commit 7ab3d23

Browse files
committed
test(ios): retain canonical secure press binding coverage
1 parent d3e3f43 commit 7ab3d23

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎packages/command-runtime/src/commands/interaction/runtime/press-readiness-binding.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,17 @@ test('equal reported values cannot rebind across producer value views', () => {
4444
const unknown = { ...source, valueSource: 'unknown' } as unknown as SnapshotNativePressTarget;
4545
expect(matchesAuthorizedPressTarget(unknown, unknown)).toBe(false);
4646
});
47+
48+
test('canonical secure input bindings ignore masked value changes', () => {
49+
const expected = {
50+
type: 'SecureTextField',
51+
label: 'Password',
52+
value: '••••',
53+
rect: cases[0]!.expected.rect,
54+
};
55+
const candidate = { ...expected, value: '••••••' };
56+
expect(matchesAuthorizedPressTarget(expected, candidate)).toBe(true);
57+
for (const type of ['TextField', 50]) {
58+
expect(matchesAuthorizedPressTarget({ ...expected, type }, { ...candidate, type })).toBe(false);
59+
}
60+
});

‎packages/kernel/src/snapshot.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export type SnapshotNativePressTarget = {
290290
identifier?: string;
291291
label?: string;
292292
value?: string;
293-
/** Guest AX inputs report the accessibility value; absent means the native raw-input view. */
293+
/** Set when TextField, SearchField or TextView values come from accessibility instead of raw input. */
294294
valueSource?: 'accessibility';
295295
rect: Rect;
296296
};

‎website/docs/docs/commands.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ A successful `click` or `press` means the action was sent to where the command f
495495
496496
When an iOS runtime advertises native press readiness, a single primary `click` or `press` with a selector or `@ref` checks whether the resolved control can receive input. If a dismissing overlay still blocks it, the command waits within its existing request budget. An already-resolved target from a mutating `find` or replay is checked once and refuses a blocked control immediately. The target's identity, frame and app must stay the same while waiting. A missing native match refuses immediately; only a matched control that cannot yet receive input is waited on. This check does not prove that a partially covered control's center is clear. Raw coordinates and non-default tap options keep their existing behavior.
497497
498-
For text inputs, readiness compares the value reported by the capture backend. Native captures retain raw contents; the guest accessibility bridge reports an accessibility value, which can equal the placeholder for an empty field. If two content states report the same accessibility value, this check cannot distinguish them.
498+
For non-secure text inputs, readiness compares the captured value. A capture can report the placeholder for an empty field, so a field whose contents change to or from that same text can still match and be pressed once unblocked. Secure-field values are omitted; readiness cannot detect their content changes. Run `snapshot -i` and use a fresh selector to re-observe the target before retrying. Add `--verify` to check for a screen change after the press.
499499
500500
A native-readiness refusal reports `COMMAND_FAILED`, `details.reason: target_not_ready`, and `details.dispatched: no`; `details.readiness` identifies the refusal or last observed state. An enclosing bounded batch or replay deadline can instead report `daemon_request_timeout`. A refused `@ref` press needs a fresh `snapshot -i` and a selector before retrying, because re-observation retires its ref frame. Cancellation retains the normal `request_canceled` reason and delivery evidence; cancellation after a request was sent can report `dispatched: unknown`. Typed native transport errors also keep their own error codes and reasons.
501501

0 commit comments

Comments
 (0)