fix: enable tvOS compilation for XCUITest runner#492
Merged
thymikee merged 4 commits intoMay 12, 2026
Conversation
XCUICoordinate type and XCUIElement.tap() are unavailable on tvOS. Gate coordinate-based interactions and touch APIs behind #if !os(tvOS) and provide tvOS alternatives using XCUIRemote (Siri Remote) actions: - tap/doubleTap → XCUIRemote.shared.press(.select) - longPress → XCUIRemote.shared.press(.select, forDuration:) - drag → directional remote press based on primary axis - back gesture → XCUIRemote menu button - app switcher → double home press - pinch/rotate → return unsupported (no-op / false) - keyboard dismiss → remote menu button - alert accept/dismiss → remote select button Verified: builds successfully for both tvOS Simulator and iOS Simulator.
Member
|
Thanks! this is a good start, I'll pick it up from here and make sure the tvOS works as advertised. |
Member
|
Updated this to make tvOS support runtime-safe, not just compilable. Siri Remote behavior is now centralized in a Swift helper, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harden tvOS runner support beyond compile-only guards by centralizing Siri Remote behavior in a shared Swift helper and wiring an explicit
remotePressrunner command through the TypeScript contract.Expose tvOS focus in snapshots, route tvOS scroll/back/home through remote buttons, and reject touch-only gestures like pinch before dispatch. Scope expanded from the original Swift compile fix to Apple-family runtime behavior across 21 files.
Validation
pnpm formatpnpm exec vitest run src/platforms/ios/__tests__/runner-client.test.ts src/utils/__tests__/snapshot-lines-focused.test.ts src/utils/__tests__/interactors.test.ts src/core/__tests__/dispatch-pinch.test.tspnpm check:quickpnpm check:fallowpnpm buildpnpm build:xcuitestpnpm build:xcuitest:tvos