Skip to content

Commit 2ab0df6

Browse files
committed
docs(ios): state the alert button-choice constraint and help refusals precisely
1 parent 9a9c49f commit 2ab0df6

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAlertButtonChoice.swift‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ import Foundation
33
/// Which of an alert's buttons an `accept` or `dismiss` activates, decided on the button labels
44
/// alone, so the rule is checkable without a screen.
55
///
6-
/// `dismiss` activates only a button `isDismissButton` recognizes. Any label-based guess at an
7-
/// unrecognized decline can only ever land on a button the accept rule does not recognize either
8-
/// — iOS localizes the App Tracking Transparency prompt's "Allow", consent copy is open-ended,
9-
/// and no list closes either set — and answering such a button while reporting `dismissed` is
10-
/// exactly the failure #3627 reports. So an unrecognized decline is refused with
11-
/// `ALERT_BUTTON_NOT_FOUND` and no tap rather than guessed at.
6+
/// `dismiss` activates only a label `isDismissButton` recognizes. An unknown decline cannot be
7+
/// identified from labels or button position: iOS localizes prompts unevenly, so one prompt can
8+
/// pair a localized decline with a still-English affirmative, and a positional guess would tap
9+
/// that affirmative and record an authorization (#3627). An unrecognized decline is therefore
10+
/// refused with `ALERT_BUTTON_NOT_FOUND` and no tap.
1211
///
13-
/// The one recognized decline outside the list is a dismiss-popup surface itself: its native
14-
/// accessibility marker is the app's own declaration that the surface closes the popover, so
15-
/// `popupMarkerSurface` lets `dismiss` take the last actionable element of that window, as
16-
/// before the #3627 rule existed. A consent prompt can never carry that marker.
12+
/// The one exception is a dismiss-popup surface itself: its native accessibility marker is the
13+
/// app's own declaration that the surface closes the popover, so `popupMarkerSurface` lets
14+
/// `dismiss` take the last actionable element of that window. A consent prompt can never carry
15+
/// that marker.
1716
enum RunnerAlertButtonChoice {
1817
static func buttonIndex(for labels: [String], action: String, popupMarkerSurface: Bool = false) -> Int? {
1918
if action == "accept" {

‎src/commands/capture/alert.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { AppError } from '@agent-device/kernel/errors';
1818
const ALERT_COMMAND_NAME = 'alert';
1919

2020
const alertCommandDescription =
21-
'Inspect, wait for, accept, or dismiss a platform alert. Use get before acting when the alert content matters; accept and dismiss change the active alert state. Each iOS XCTest execution activates once, then only observes. On the Apple XCUITest runner, dismiss taps only a button on its decline list (plus a popover marked dismissable) and refuses ALERT_BUTTON_NOT_FOUND rather than guess at unknown wording; press the button by label when a prompt uses it. Inspect again after an unconfirmed action; never assume a timeout means nothing happened.';
21+
'Inspect, wait for, accept, or dismiss a platform alert. Use get before acting when the alert content matters; accept and dismiss change the active alert state. Each iOS XCTest execution activates once, then only observes. On the Apple XCUITest runner, dismiss taps only a recognized decline label (Cancel, Don\'t Allow, Ask App Not to Track, and similar) or the close element of a popover whose accessibility marker reads exactly "dismiss popup"; when no button fits the action, accept and dismiss answer ALERT_BUTTON_NOT_FOUND having tapped nothing — read labels with alert get, then press the button by label. Inspect again after an unconfirmed action; never assume a timeout means nothing happened.';
2222

2323
const alertCommandMetadata = defineFieldCommandMetadata(
2424
ALERT_COMMAND_NAME,

0 commit comments

Comments
 (0)