Read-only mirror of github.com/ondeinference/xcrs-controlkit.
Mirrored from https://github.com/ondeinference/xcrs-controlkit.git
Synced Nov 24, 19:30 UTC
feature/macos-runner-automation
| 1 | # ControlKit macOS host app |
| 2 | |
| 3 | This folder holds the macOS host application (`ControlKitRunnerApp.swift` and |
| 4 | `Assets.xcassets`) for the `ControlKit-macOS` target in the shared |
| 5 | `XCRSControlKitRunner.xcodeproj`. |
| 6 | |
| 7 | macOS is pointer-driven: `device.io.click` clicks, `device.io.drag` presses and |
| 8 | drags, `device.io.scroll` turns the scroll wheel, `device.io.text` types and |
| 9 | `device.io.key` presses a key with optional modifiers (`command`, `shift`, |
| 10 | `option`, `control`, `function`). Coordinates are screen points, the space |
| 11 | `device.dump.ui` reports rects in; the runner anchors them on the app window |
| 12 | under the point, because the application element itself has no frame on macOS. |
| 13 | `device.window.resize` moves and resizes the main window, and |
| 14 | `device.screenshot` captures it (or the whole screen) as a PNG. Raw |
| 15 | `device.io.tap` (touch), `device.io.swipe`, `home`, and orientation controls |
| 16 | are intentionally unsupported. |
| 17 | |
| 18 | Every method that names an app accepts `path` (the `.app` bundle) as well as |
| 19 | `bundleId`. A bundle identifier resolves through LaunchServices, which picks |
| 20 | one copy when several are installed, so name the path when testing a build that |
| 21 | is not the one in `/Applications`. `device.apps.activate` foregrounds an app |
| 22 | that is already running; `device.apps.launch` on an app started outside the |
| 23 | runner can block for minutes and then fail with "does not have a process ID". |
| 24 | |
| 25 | XCTest prints a macOS control's text as `title` and a static text's value |
| 26 | unquoted. `device.dump.ui` reports the title as `label` and reads the unquoted |
| 27 | value, and `device.ui.tap` matches titles, narrowed with `type` (for example |
| 28 | `Button`) or `index` when a web view repeats the same text. The JSON-RPC |
| 29 | transport and server live in `../Shared` and are compiled into the |
| 30 | `ControlKit-macOS-UITests` target. |
| 31 | |
| 32 | The generated XCUITest runner ships sandboxed with only the network *client* |
| 33 | entitlement, so `ControlKit-macOS-UITests.entitlements` additionally grants |
| 34 | `com.apple.security.network.server`, allowing the runner to bind its local RPC |
| 35 | port. The targets sign locally (`CODE_SIGN_IDENTITY = "-"`), so no team or |
| 36 | provisioning profile is required to build and test. |
| 37 | |
| 38 | `device.io.swipe`, `device.io.orientation.*` and `device.hinge.get` are not available on this runner. |