pinch, rotate and multiTouch put several real fingers on the screen at once: synthesized UITouches
in one event on iOS, multi-pointer MotionEvents on Android, CDP Input.dispatchTouchEvent on the web.
Like every action, they wait for the app to be idle before and after (every call
waits) and take the call options.
They need real touches:
jsmode cannot run them: gesture recognizers need real touches.- On the web they need a viewport with touch. A viewport without touch fails with
ACTION_NOT_SUPPORTED. Tag tests that need several fingers so such viewports can skip them (test tags); the example app tags them@multi-touchand runs its desktop viewport with--tags 'not @multi-touch'.
Pinch and rotate
pinch(target, scale, options?)
MatcherInput · PinchOptions · ElementSummary
Two fingers on the element move apart (scale > 1, zoom in) or together (scale < 1, zoom out) until
their distance has changed by scale.
scale must be a positive number. A pinch that does not fit on the screen in one go (e.g.
pinch('map', 10)) is done as several pinches, as a user would. The fingers go down on the element and
stay in the window.
rotate(target, radians, options?)
MatcherInput · RotateOptions · ElementSummary
Two fingers turn radians around the element’s center; positive is clockwise on screen.
Recognizer thresholds
A gesture recognizer starts measuring only once it activates, after the fingers have moved a little. So a plain “fingers twice as far apart” shows up in the app as a scale below 2. Quiesco first moves the fingers by that activation distance, so the app’s recognizer reports the requested scale or angle (measured within about 2% and 1°). The defaults are the platforms’ standard recognizers:
For another recognizer, set
actions.gestureSlop: { pinch, rotation } in logical
units and radians. 0 moves the fingers exactly by scale / radians.
Any touch paths
multiTouch(fingers, options?)
TimedPoint · MultiTouchOptions
Moves any fingers along timed paths. fingers[i] is finger i’s list of { x, y, t } points, t in
milliseconds from the start; a finger is down from its first point to its last.
It takes 1 to 10 fingers. Each finger needs at least one point, and its times must be non-negative and
non-decreasing.