Drag
Pan or drag a draggable element. Two modes — Auto (AI-driven, describe the handle in plain language) and Hardcoded (explicit normalized coordinates).
Drag handles continuous gestures: pulling a slider thumb, panning a map, dragging a drawer. Two modes — describe what to drag in natural language, or supply explicit start/end coordinates.
In Auto mode, you describe the handle in plain language and where to drag it. If Until is set, Mavster iterates the gesture until the condition is met.
In Hardcoded mode, you supply explicit start/end coordinates as 0–1 values across the screen. The same coordinates work across screen sizes.
Settings — Auto mode
The Drag editor in Auto mode exposes:
| Field | What it does |
|---|---|
| Mode | Auto (AI-driven) or Hardcoded (explicit coordinates). Default Auto. Switching mode swaps the rest of the form. |
| What to drag | Description of the draggable element — knob, slider thumb, drawer handle. Placeholder: 'e.g., slider thumb, drawer handle'. |
| From (optional hint) | Start hint, e.g. 'center of map'. Leave empty to auto-detect from 'What to drag'. |
| Drag to | Destination hint, e.g. '50% position', 'fully open', 'southwest direction'. |
| Until (optional) | Optional question for iterative drags — e.g. 'Do you see Australia on the map?'. Mavster keeps dragging until the answer is yes. |
| Duration (seconds) | Length of the drag gesture. Default 0.5. |
| Region of Interest | Default 'content'. Narrows handle detection to a band of the screen. See Region of Interest. |
Settings — Hardcoded mode
| Field | What it does |
|---|---|
| Mode | Switch to Hardcoded to enter explicit coordinates. |
| From X / From Y | Start point as a normalized 0.0–1.0 coordinate. |
| To X / To Y | End point as a normalized 0.0–1.0 coordinate. |
| Duration (seconds) | Length of the drag gesture. |
| Region of Interest | Default 'content'. |
The editor includes an inline note: "Coordinates are normalized (0.0 - 1.0)".
When the test's self-healing mode is Per Step, a per-step Self-healing toggle also appears.
What's possible
-
Sliders: Mode = Auto, What to drag = volume slider thumb, From = current position, Drag to = 80% position.
-
Maps: Mode = Auto, What to drag = map, From = center of map, Drag to = southwest direction, Until = Do you see Australia on the map?
-
Drawers and bottom sheets: describe the handle in What to drag and a destination state in Drag to (e.g. "fully open").
-
Reproducible coordinate-based drags: flip to Hardcoded mode and supply 0–1 coordinates. Same gesture, every run.
What's not possible
-
Multi-finger gestures (true pinch/zoom) — Drag is single-finger.
-
Drag-and-drop between two arbitrary elements — you can fake it with start near the source and end near the target, but Mavster doesn't model "pick up and drop" as a first-class operation.
-
Asserting state during a drag — Drag emits the gesture, then the next step asserts. Use Until for the in-drag stop condition; use a Visual Assert for the post-drag check.
Common patterns
-
Use Until on iterative drags. Maps especially: "drag the map southwest until you see Australia" beats "drag the map by exactly 600 px five times".
-
Adjust Duration for stiff or animated controls. The default 0.5 s is fine for sliders; bump it for sticky handles or animated transitions.
-
Hardcoded mode for snapshot tests. When you want a regression test that checks the same exact gesture every run, hardcode the coordinates rather than letting AI re-resolve.
Related
- Region of Interest — when and what to pick.
