Skip to content

fix(ios-runner): one synthesize-then-fallback helper; sequence taps use the standalone tap policy - #2865

Merged
thymikee merged 3 commits into
mainfrom
fix/2788-synthesized-tap-fallback
Sep 24, 2026
Merged

thymikee merged 3 commits into
mainfrom
fix/2788-synthesized-tap-fallback

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

One helper now owns synthesize-then-XCTest-fallback at every synthesized tap site in the Apple
runner, instead of each call site improvising its own fallback. Sequence tap steps now go through
the standalone tap's .coordinateTap policy, including its nil-context behavior, so a sequence tap
and a standalone tap on the same target report the same interaction kind. Unused synthesized-gesture
policy cases were removed along with the divergent per-site fallback logic; net production is about
-34 lines. Touches 16 files.

Closes #2788

Validation

Tested at head 2d0f9562ba68e0e95e7d269f88807b88e250dbdc.

  • pnpm check:affected --run: all runnable checks passed (unit, xctest-selection,
    packaged-runner-swift, maestro-conformance, mutation-model).
  • check:xctest-selection: 299 declared methods; host lane reaches 243, PR iOS-Simulator lane
    selects 110, nightly reaches 297; 0 unreachable.
  • Runner XCTest suite exercised live on an iOS Simulator; the macOS host lane is blocked locally by
    signing and is covered by CI instead.
  • Live evidence from the pre-rebase validation at 445e197fe2: before the fix, a sequence tap
    logged kind=synthesizedDrag where the standalone tap logged kind=coordinateTap on the same
    target; after the fix, both report coordinateTap and both land.
  • AX-unavailable fallback path is covered only by the simulator test, not by a unit test.
  • Known gap: no test currently fails if the nil-context early return in performSequenceStep is
    reintroduced; this is unenforced regression risk on that one branch.
  • Rebased over refactor(move): move the runner's inline unit tests into UnitTests/ #2854 and refactor(move): split RunnerTests+CommandExecution.swift along command families #2855's test-file moves; reviewed.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.80 MB 4.80 MB -979 B
Package (unpacked) 4.80 MB 4.80 MB -979 B
Package (download) 1.44 MB 1.44 MB +69 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.8 ms 28.7 ms -0.1 ms
CLI --help 82.7 ms 80.0 ms -2.7 ms

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at 2d0f956. The six synthesized-gesture sites now go through one helper that picks the fallback from the existing synthesizedGesturePolicy table, and production lines go down by 34. I found no blocking defect.

One design question: coordinateTap's fallback policy always allows fallback, so the switch keeps a few .refused arms that cannot be reached. Would a two-variant result for those kinds be simpler, or is the exhaustive switch the simpler shape here?

Not blocking: the drag plan-nil branch now returns INVALID_ARGS for non-finite coordinates instead of the old XCTest fallback, and the nil-context sequence route (window unresolved) still has no direct test.

The live before/after evidence for the sequence-tap fix is author-reported at 445e197, before the rebase. The rebase carried only move-only changes, so that evidence still covers the changed path.

The Smoke Tests failure at get text id="automation-event-name" looks unrelated. That step follows launch, the deep-link alert wait and the landmark wait, and none of them runs a synthesized tap, sequence step, drag or back tap. #2788 asks for a green iOS simulator smoke run, so please re-run it. If the step fails again, check the step-14 snapshot before you attribute it to this PR.

… helper

A synthesized tap step inside `sequence` resolved its context with the
synthesized-drag policy, so it refused the XCTest coordinate fallback when
accessibility was unavailable and failed outright when no window frame
resolved. A standalone synthesized tap falls back in both cases.

`performSynthesizedGesture` now performs the synthesized gesture, decides the
XCTest coordinate fallback from the gesture kind's policy, and logs the
decision. Selector tap, coordinate tap, sequence tap step, type focus and
drag use it; each site keeps its own XCTest gesture and bookkeeping. A
sequence tap step takes the coordinate-tap policy, and the fallback decision
reads the kind rather than a policy copy on the coordinate context.

Remove the unused `whenAccessibilityHealthy` keyboard policy, the drag
fallback branch that a nil frame could never reach, and the text-entry focus
predicate the helper replaces. Scroll keeps `privateSynthesisRequired`.

Fixes #2788
…sture helper

Pin the sequence tap step fallback at the sequence command response with a
simulator test that forces private tap synthesis to fail while accessibility
is unavailable.
@thymikee
thymikee force-pushed the fix/2788-synthesized-tap-fallback branch from 2d0f956 to 60c57c6 Compare September 24, 2026 13:54
@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at 60c57c6 and it looks clean. The evidence-pending issues from the earlier review (2d0f956) are resolved, since no code changed in this delta and the live sequence-tap validation and the earlier run carry over.

Smoke Tests is still running with no failure log yet, and this PR's changes overlap that route through the synthesized tap, sequence, and drag fallback sites in the Apple runner, so wait for it to go green before merging.

Not blocking: the rebase pasted five stale lines about a nonexistent unsettledGesture field into CHANGELOG.md (lines 38-42, https://github.com/callstack/agent-device/blob/60c57c6/CHANGELOG.md#L38-L42), which contradict the sentence above them about click/press/fill not disclosing the field yet, and can be dropped or left as is.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 24, 2026
@thymikee
thymikee merged commit 81aff32 into main Sep 24, 2026
18 checks passed
@thymikee
thymikee deleted the fix/2788-synthesized-tap-fallback branch September 24, 2026 15:19
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-24 15:19 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ios-runner): one synthesize-then-XCTest-fallback helper; align sequence tap with standalone tap

1 participant