fix(ios): fill succeeds when app removes input after last character

Merged
OK
2mo ago
+398-5

Summary

fill into an auto-submitting code field failed with XCTEST_RECORDED_FAILURE (reading frame on the removed input) and invalidated the runner.

The runner (Swift only) now:

  • binds the input's type and identifier at the first resolve. resolveTextEntryElement refuses any other input at every post, warmup read-back, verify poll and repair.
  • before the last post, a refused resolve returns TEXT_INPUT_NOT_FOCUSED. After full delivery, the fill is unverified ok "typed" only on XCTest's no-match (com.apple.dt.xctest.ui-testing.error 10008); any other error returns TEXT_INPUT_COMMIT_NOT_OBSERVED.
  • refuses repair when the bound input has no identifier.
  • composes with #3171: its unconfirmed check only reads inputs the bound resolver accepted, and the removal verdict runs first.

Limits:

  • A successor with the same type and identifier is indistinguishable, including an empty one: an unnamed field replaced mid-fill by an unnamed focused field gets the remaining posts. That fill fails TEXT_ENTRY_MISMATCH without repair, but the successor keeps the text.
  • The penalized-channel route (runSynthesizedReplacementRoute) is not covered.
  • Proving no-match costs ~2 s.

5 files.

Validation

Tested commit: 0eef3bb26 (rebased on upstream/main 294dc7d02, after #3171).

  • pnpm check:affected --run --base upstream/main passed.
  • 61 text-entry runner XCTests (this PR's and #3171's) pass on an iOS 27.0 sim.
  • Live CLI, iOS 27.0 sim, one runner process: OTP digit-count fill ok unconfirmed ("0 of 6 digits" to "6 of 6 digits"); auto-submit fill ok with INPUT_REMOVED_AFTER_DELIVERY, no repair; then a tap.
  • CI: all green, including iOS Smoke (87 runner XCTests) and macOS Smoke.