Skip to content

Add a local iPhone Duo end-to-end check - #36

Draft
janicduplessis wants to merge 2 commits into
mainfrom
@janic/e2e-ios
Draft

janicduplessis wants to merge 2 commits into
mainfrom
@janic/e2e-ios

Conversation

@janicduplessis

Copy link
Copy Markdown
Contributor

Adds pnpm run e2e:ios (e2e/ios.mjs), a local-only counterpart to e2e:android that checks the iPhone Duo behavior recorded in the 0.2.0 verification doc, using only the example's on-screen text. No library changes, no logging patch, and no workflow in the repo.

The script builds and installs the example in Release (no Metro), reuses or creates its own Reserved Regions E2E Duo simulator (or takes E2E_IOS_UDID), opens the hinge to 130° with agent-device fold, and asserts:

  • Full screen: Ready, one division centered within 45–55% of the provider width with y 0 and the provider's height (±2 pt), one occlusion in the top-right corner.
  • Shift 40: same provider size, division x = full-screen x − 40 (±1).
  • Content box: one division with negative y and height larger than the provider (unclipped), no occlusion.
  • Inset 24: 180° removes the division with the provider size unchanged; back to 130° restores the same division and provider size.

It uses tolerances rather than the exact Duo numbers, and reads each state only after two consecutive snapshots match, because a fold dispatches several intermediate payloads.

Fails fast before building unless it finds Xcode ≥ 27.1, the iPhone Duo device type, an iOS ≥ 27.1 runtime that supports it, and agent-device ≥ 0.21.12 (needed for fold). The message names what to install.

docs/workflow.md gets an "Automated iOS check" section, and the verification doc gets a one-line pointer to the script.

@janic/duo-verify stays: the verification doc still cites a9b3f08 on that branch.

Test plan

  • End to end: passed on a throwaway branch (now deleted) that ran pnpm run e2e:ios on xcode-27-xlarge with Xcode 27.1 beta and a downloaded iOS 27.1 runtime: run 35926702428, 5.4 min for the script and 9m46s for the job. It printed the same values as the verification doc, for example:
    01-full-screen-130: Provider: 951.0 × 669.0 | Measurement: Ready | division · x 455.5 · y 0.0 · 40.0 × 669.0 · content visible | occlusion · x 867.0 · y 0.0 · 84.0 × 120.0
    pass: full screen: division center 475.5 is 50.0% of provider width 951.0
    pass: shift 40: division x 415.5 is within 1 point of 415.5
    pass: content box: division height 669.0 exceeds provider height 389.0
    pass: 180°: no division, got 0
    pass: back to 130°: division (431.5, -24.0, 40.0, 669.0) matches the one before 180°
    ios end-to-end check passed
    
  • Fail fast on a Mac with only Xcode 26.6:
    ios end-to-end check failed: Xcode 27.1 or newer is required for the iPhone Duo simulator, but /Applications/Xcode.app/Contents/Developer is Xcode 26.6. Install Xcode 27.1 beta from https://developer.apple.com/download/applications/ and set DEVELOPER_DIR to its Contents/Developer directory.
    
  • Not triggered directly: the device-type, runtime and agent-device failure messages. On the runner, all four checks passed.

130° full screen
180° inset 24

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant