Skip to content

Commit 5ebb76d

Browse files
thymikeeclaude
andcommitted
docs(ios): name what each back swipe refusal means
back_swipe_no_change: the swipe was sent and the screen did not change. back_swipe_unverified: the swipe may or may not have navigated, because the screen kept changing before it or could not be sampled after it. The unreadable-tree test now terminates its fixture on every path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 184246f commit 5ebb76d

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ final class RunnerTests: XCTestCase {
4040
/// discloses dispatched: no.
4141
/// `ALERT_UNRESOLVED` means required alert acquisition failed or exhausted its deadline.
4242
/// It establishes no absence and activates nothing, so dispatched: no.
43-
/// `BACK_SWIPE_NO_CHANGE` is a back swipe that left the app's screen unchanged, and
44-
/// `BACK_SWIPE_UNVERIFIED` one whose screen could not be sampled afterwards. Both ran the swipe.
43+
/// `BACK_SWIPE_NO_CHANGE` is a back swipe that left the app's screen unchanged.
44+
/// `BACK_SWIPE_UNVERIFIED` is one whose screen kept changing on its own before the swipe, or could
45+
/// not be sampled afterwards. Both ran the swipe.
4546
enum RunnerWireErrorCode {
4647
static let mainThreadTimeout = "MAIN_THREAD_TIMEOUT"
4748
static let appNotRunning = "APP_NOT_RUNNING"

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+NavigationTests.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ extension RunnerTests {
6666
@MainActor
6767
func testInAppBackOnAnUnreadableTreeVerifiesTheSwipeOnTheSoleScreen() throws {
6868
let status = try launchBackFixture(["--agent-device-back-regression"])
69+
// Terminates whichever fixture instance is running when the test leaves, on every path.
70+
defer { endBackFixture() }
6971
let answered = try withRejectedAppTree(framesReadable: false) { try performInAppBack(app: app) }
7072
let soleScreenOpen = soleScreenRouteIsOpen(for: app)
7173
let answeredLabel = status.label
7274
endBackFixture()
7375
_ = try launchBackFixture([])
74-
defer { endBackFixture() }
7576
let ignored = try withRejectedAppTree(framesReadable: false) { try performInAppBack(app: app) }
7677

7778
guard soleScreenOpen else {

‎packages/command-surface/src/system/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export const SYSTEM_COMMAND_OUTPUT_SCHEMAS = {
286286
const appStateCommandDescription =
287287
'Show foreground app/activity (Android and HarmonyOS; iOS and macOS answer per session)';
288288
const backCommandDescription =
289-
'Navigate back in the app or through system navigation. Use in-app for the app navigation stack and system when the platform back behavior is required. On iOS both modes swipe from the left edge and succeed only when the app screen changes; an unchanged screen refuses with reason back_swipe_no_change. An app with a left-edge drawer may open the drawer instead. Press a visible back or close control by its ref directly.';
289+
'Navigate back in the app or through system navigation. Use in-app for the app navigation stack and system when the platform back behavior is required. On iOS both modes swipe from the left edge and succeed only when the app screen changes. Reason back_swipe_no_change: the swipe was sent and the screen did not change; press the visible back or close control. Reason back_swipe_unverified: the swipe may or may not have navigated, because the screen kept changing before it or could not be sampled after it; check with snapshot. When the screen cannot be sampled before the swipe, back does not swipe. An app with a left-edge drawer may open the drawer instead. Press a visible back or close control by its ref directly.';
290290
const homeCommandDescription =
291291
'Send the selected device to its home screen. This leaves the app session open but moves the foreground away from the app.';
292292
const orientationCommandDescription =

‎website/docs/docs/commands.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ iOS Simulator launch behavior:
124124
Back, orientation, and hardware buttons:
125125

126126
- `back` uses app-owned back navigation: the back keyevent on Android, the visible back control on macOS, and the Siri Remote Menu button on tvOS. `--in-app` names this default explicitly.
127-
- On iOS, `back` is the left-edge back swipe, with or without `--in-app` or `--system`. It succeeds only when the app's screen changes. An unchanged screen refuses with `reason: back_swipe_no_change`. It waits up to about a second for the screen to stop changing before it swipes. If the screen keeps changing on its own, or cannot be sampled after the swipe, the result is an unknown outcome (`back_swipe_unverified`). If the screen cannot be sampled before the swipe, `back` does not swipe.
127+
- On iOS, `back` is the left-edge back swipe, with or without `--in-app` or `--system`. It succeeds only when the app's screen changes. It waits up to about a second for the screen to stop changing before it swipes.
128+
- `reason: back_swipe_no_change`: the swipe was sent and the screen did not change. Press the visible back or close control.
129+
- `reason: back_swipe_unverified`: the swipe may or may not have navigated, because the screen kept changing before the swipe or could not be sampled after it. Check with `snapshot`.
130+
- If the screen cannot be sampled before the swipe, `back` does not swipe.
128131
- An app with a left-edge drawer may open the drawer instead of going back. When a back or close control is visible, press it by its ref.
129132
- `back --system` sends system back input: the Android back keyevent, the iOS back swipe, or the tvOS Siri Remote Menu button. macOS has no system back, so it refuses before dispatch.
130133
- `orientation portrait|portrait-upside-down|landscape-left|landscape-right` works on iOS and Android mobile targets only. On ADB-backed Android it turns auto-rotate off, and the lock persists after the session ends until something turns it back on. A foldable iPhone simulator (iPhone Duo) refuses `portrait-upside-down`, and refuses every rotation in a scoped simulator set (`--ios-simulator-device-set`).

0 commit comments

Comments
 (0)