Interaction

Steps for tapping, swiping, typing text, and scrolling elements.

tap

Tap the element once.

Parameters

FieldTypeRequiredDescription
selectorstringYesElement selector

Example

- tap:
    selector: '#submit-button'

Tips

  • iOS: All 4 orientations supported (Portrait, Portrait180, LandscapeA, LandscapeB). Auto-detected via xcrun simctl spawn or forced with config.orientation.
  • Android: No orientation correction needed.

swipe

Swipe on the element.

Parameters

FieldTypeRequiredDescription
selectorstringYesTarget element selector
directionstringYesup | down | left | right
distancenumber | stringNoSwipe distance. Number for dp, string like '50%' for percentage of element size. Default if omitted

Example

- swipe:
    selector: '#list'
    direction: up
    distance: 200 # absolute 200dp
- swipe:
    selector: '#carousel'
    direction: left
    distance: '80%' # 80% of element width

typeText

Type text into the element (replaces existing content).

Parameters

FieldTypeRequiredDescription
selectorstringYesInput target selector
textstringYesString to type

Example

- typeText:
    selector: '#email'
    text: user@example.com

inputText

Type text into the currently focused field.

Parameters

FieldTypeRequiredDescription
textstringYesString to type

Example

- inputText:
    text: Hello

longPress

Long-press an element. Wraps tap + duration for readability.

Parameters

FieldTypeRequiredDescription
selectorstringYesElement to long-press
durationnumberNoPress duration (ms). Default 800

Example

- longPress:
    selector: '#item-3'
    duration: 1000

doubleTap

Double-tap the element.

Parameters

FieldTypeRequiredDescription
selectorstringYesElement selector
intervalnumberNoDelay between taps (ms). Default 50

Example

- doubleTap:
    selector: '#zoomable-image'
    interval: 100

clearText

Clear all text from a TextInput.

Parameters

FieldTypeRequiredDescription
selectorstringYesTarget TextInput selector

Example

- clearText:
    selector: '#email'

scrollUntilVisible

Scroll until the element is visible (repeat up to limit).

Parameters

FieldTypeRequiredDescription
selectorstringYesElement to make visible
directionstringNoup | down | left | right. Default down
maxScrollsnumberNoMax scrolls. Fails if exceeded

Example

- scrollUntilVisible:
    selector: '#footer'
    direction: down
    maxScrolls: 10