feat(screen): accept percent points in tapAt, doubleTapAt, and swipe

RE
1h ago
+231-51

What and why

  • screen.tapAt({ x: '50%', y: '50%' }) now taps the middle of the screen. Works for doubleTapAt and swipe too.
  • Plain numbers are still pixels without additional overhead.
  • Unlike Maestro, decimals work too: '12.5%' rounds to the nearest pixel.

Issue

Part of #1855 (screen.tapAt({ x: '50%', y: '50%' }) row).

Verified

Ran it locally: yes

  • Web, testbed, e2e run tests/pointer.e2e.ts.

  • iOS, iPhone 17 Pro, mobile benchmark's Control Inventory. Not run on Android.

  • An out-of-range percentage fails before the screen is read:

    INVALID_ARGUMENT: tapAt takes a percentage from '0%' through '100%', got "120%"
    
  • Perf: percent point costs one screen read. Median per tapAt, M4, pixel and percent taps alternating:

    surfacepixelspercentextra
    web, testbed /pointer5.3 ms10.2 ms+4.9 ms
    web, 1,000 buttons26.1 ms50.5 ms+24.4 ms
    web, 5,000 buttons56.6 ms107.7 ms+51.1 ms
    iOS simulator720 ms877 ms+157 ms
Videos: web testbed and iOS

https://github.com/user-attachments/assets/aea6c12a-c7dc-490a-9972-9cff095db83a

https://github.com/user-attachments/assets/991390c4-d200-4fa4-ae49-815ee6d9c091

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and both fixtures.
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/web, and @e2e-dev/mobile.