Perform and record one action step on the device. Performs the action and records it with automatic page source + element capture. Coordinates are in video / iOS-automation space — use flow_recording_start's windowSize as the reference.
Actions:
- tap / doubleTap / longPress / swipe — gesture actions (require x,y; swipe also needs toX,toY)
- sendKeys — type text into the focused field
- keyPress — press an Android keycode (e.g. 3=HOME, 4=BACK)
- wait — pause for waitMs milliseconds
- pressButton — press a hardware button by name ('home', 'volumeUp', 'volumeDown', 'lock'). Performed live on the device during recording. Android maps to hardware keycodes; iOS invokes the native hardware-button command.
- assert — record a UI assertion check (no device gesture). Identifies the target element at (x,y), then at replay time verifies the assertion condition. Assertion failures mark the step as FAILED and surface the mismatch in errorMessage. Makes the recording a real verifiable test. assertType 'visualMatch' is the exception: it takes no x/y and no expected, and at replay time compares the whole screen against the screenshot captured now.
- scrollToElement — record a scroll-until-visible checkpoint (no device gesture). Binds the element at (x,y) now; at replay time it scrolls until that element is back on screen, searching downwards first and then upwards, and reports the element's live coordinates. Use it before acting on something whose position varies between runs (a row in a long list, a button below the fold). This FAILS the run if the element never comes into view, because the step exists to bring a target into view for the step that follows it. Note you do NOT need a separate step to resolve an element before acting on it — every element-bound action re-resolves its own target at replay; use scrollToElement only when the target is genuinely off screen, and assert/exists when its absence should fail the run.
- appLaunch — launch an app mid-flow by appId (Android package name, iOS bundle id; optional appActivity on Android). Launches live during recording and relaunches the same app at replay time. Use it to switch apps or to return to the app under test after leaving it.