QA: no way to test touch controls or mobile Safari (touch input, WebKit, iOS Simulator)

Aperta
#3,058 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
playwright, typescript
Ambito
testing

Direzione di ricerca

Start at the $B browse commands and the /qa workflow, which today only resize a Chromium viewport via Emulation.setDeviceMetricsOverride. First slice: a device mode ($B device "iPhone 15") plus tap/swipe/pinch/touch built on Playwright device descriptors and CDP Input.dispatchTouchEvent. Then add Playwright WebKit as a browse/QA engine, and gate --mobile on Xcode presence by driving iOS Safari through safaridriver and xcrun simctl io with the listed quirks encoded. Done when the QA report gains a touch section listing devices, engines, gestures, emulated vs real, and flags iOS multi-touch as non-automatable.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement parked S3

Summary

gstack's QA and browse workflows can't test touch controls. responsive and the design-review captures only resize a Chromium viewport (Emulation.setDeviceMetricsOverride). Nothing in gstack can send touches, run Safari's engine (WebKit), or drive a real mobile browser. So for a phone or tablet feature, /qa can show what the page looks like at phone size, but not whether it works on a phone.

What happened

I was adding on-screen touch controls to a browser game (garrytan/bel-doom#4): a floating stick on the left half of the screen, plus FIRE, USE and strafe buttons, with multi-touch (run, turn and fire at once). gstack 1.91.27.0 had nothing for this, so I built three harnesses by hand:

  1. Playwright WebKit and Chromium with device descriptors (devices['iPhone 15'], 'iPad Pro 11', 'Pixel 7', 'Galaxy Tab S4', portrait and landscape): pointer: coarse, hasTouch, safe areas and dvh layout, and a screenshot of each.
  2. Multi-touch through CDP (Input.dispatchTouchEvent with several touchPoints) on Chromium, to check that two fingers held at once give the union of their keys and that lifting one finger releases only its own keys. Playwright's WebKit has no multi-touch API, so there I had to dispatch synthetic PointerEvents.
  3. Real iOS Safari in the Xcode iOS Simulator on the paired Mac, through safaridriver (safari:useSimulator, safari:deviceUDID) and W3C actions with pointerType: 'touch', plus xcrun simctl io <udid> screenshot.

Number 3 was the only real-browser check, and it turned up several quirks that a skill should already know:

  • Lifting a finger. pointerUp is delivered only when the input state is released (DELETE /session/:id/actions). In an action chain that ends in pointerUp, the page sees pointerdown and the moves; the up arrives at the release, at (0,0).
  • Gesture boundaries. A pointerMove sent as a separate actions call after the finger is down shows up as an up then a down at the new spot. So the reliable pattern is one action chain per gesture (down, moves, up), then read the page state, then DELETE /actions.
  • One finger only. Two pointer sources in one actions call don't produce two simultaneous touches, so multi-touch on real iOS Safari can't be automated this way.
  • Element clicks. element/click produced a touch move but no pointerdown/click on the button, so taps have to be coordinates from getBoundingClientRect.
  • Second simulator. With an iPhone simulator already booted, starting a session on an iPad simulator timed out ("Finding or launching a compatible remote Safari and waiting for its RWIApplication to appear"). It probably needs Safari launched on that device first, or the other simulator shut down.
  • Fullscreen. document.fullscreenEnabled was true in iOS 18.7 Safari, and requestFullscreen() from a touch worked: the viewport grew from 714 to 874 CSS px tall. The assumption that "iPhone Safari has no fullscreen" is out of date.

Proposal

  • A touch-aware browse mode. $B device "iPhone 15" (descriptor: viewport, DPR, hasTouch, mobile UA), plus $B tap x y | selector, $B swipe, $B pinch, and $B touch for multi-finger sequences (CDP Input.dispatchTouchEvent on Chromium).
  • WebKit as an engine choice for browse and QA, through Playwright WebKit (on Linux it needs playwright install-deps webkit), so Safari layout and event bugs show up in cloud QA.
  • /qa --mobile. When Xcode is present (on a paired Mac), run the flow in real iOS Safari via safaridriver and simctl, with the quirks above built in: one chain per gesture, release to lift, coordinate taps, and boot or launch Safari before creating a session. Report that multi-touch can't be automated there instead of skipping it silently. Use an Android emulator when the SDK is present.
  • A QA report section for touch. Devices and engines covered, gestures exercised, what's emulated versus a real browser, and what still needs a human on a physical device.

Environment

  • Capy cloud machine (Ubuntu 24.04, Node 24, Playwright 1.63, WebKit 2359), plus a paired M4 Max Mac (Xcode, iOS 26.5 simulator runtime with Safari reporting iOS 18.7, safaridriver).
  • gstack 1.91.27.0.
Lingua principale
TypeScript
Stelle
143k
Fork
21k
Merge medio
5h 25m
PR unite (30g)
791

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di garrytan/gstack

Tutte le issue di garrytan/gstack

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.