← back to Govarbitrage
apps/mobile/device-proof-evidence/GovArbUITest/README.md
52 lines
# GovArbUITest — physical-device journey capture (TK-10279)
Standalone, throwaway XCUITest that drives the **already-installed** GovArbitrage app
(`com.abrams.govarbitrage`) on a physical iPhone **by bundle id** and captures each screen
**in-process** via `XCUIScreen.main.screenshot()` as `XCTAttachment`s. This bypasses the dead
`idevicescreenshot` / DDI screenshot path on iOS 26.
It is **independent** of the shared GovArbitrage Xcode project (that one is built by other agents);
this project has a single UI-testing target and nothing else.
## What it captures
1. `cold-launch-opportunities` — the Opportunities list on live data
2. `detail-maxbid-valuation` — a listing detail (Recommended Max Bid + Valuation rows)
3. `settings` — the Settings screen
4. `settings-connection-test` — after tapping **Test Connection** (green "Connected … Tier: PREMIUM" banner)
5. `siwa-available` — asserts the **Sign in with Apple** button EXISTS (never taps it)
Because the Opportunities list holds ~2,500 cards, a full accessibility snapshot of it stalls the a11y
server, so the big list is driven with **normalized-coordinate taps** (first card ≈ 0.5/0.30, Settings
tab ≈ 0.75/0.95, Test Connection ≈ 0.5/0.72). Element queries are reserved for the small Settings screen.
## Run
The device must be **unlocked** (set Auto-Lock → Never); `xcodebuild` hangs at preflight otherwise.
```sh
xcodebuild test \
-project GovArbUITest.xcodeproj -scheme GovArbUITests \
-destination 'platform=iOS,id=<DEVICE_UDID>' \
-derivedDataPath ./DerivedData -resultBundlePath ./result.xcresult \
-allowProvisioningUpdates \
-authenticationKeyPath ~/.appstoreconnect/private_keys/AuthKey_72Y2TZT54R.p8 \
-authenticationKeyID 72Y2TZT54R \
-authenticationKeyIssuerID cfbd63ed-301b-465c-aad7-49e94420ad70
```
Signing: automatic, team `3VAV3KMNZK`, runner bundle id `com.abrams.govarbitrage.uitests`.
## Extract the screenshots
```sh
xcrun xcresulttool export attachments --path result.xcresult --output-path attachments
# named PNGs land under attachments/ with a manifest.json mapping human-readable names
```
## watch-capture.sh
Background helper that retries the test until the phone is unlocked, then exports the named PNGs and
copies them into `../` as `device-journey-<n>-<step>-<ISO>.png`. Useful when the device auto-locks
between runs. Edit the hard-coded paths/UDID at the top before reuse.
## Hard gates (local dev only)
No App Store Connect submit/reply/upload/resubmit; no Apple identity beyond dev signing; no prod/data
writes; no remote push. The app runs on live data (it is an ungated app-client).