Files
sanderling/docs/development/action-space.md
T
pj 759803e684 docs: correct three claims the audit checked against the code
PressKey has 9 keys, not 8: escape was missing. Scroll has no durationMillis on
the authored side; the runtime entry supplies one. And decisions.md described a
marshal.go move that never happened as settled, and a runs.go split that is
done as pending.
2026-08-22 21:14:02 +05:30

50 lines
2.2 KiB
Markdown

# Action Space
Inventory of user interaction primitives Sanderling currently supports, compared against the full set available through the native driver layer.
## Current Actions
| Action | Parameters | Notes |
|--------|-----------|-------|
| `Tap` | `on` (selector or element) | Single tap on element or coordinates |
| `DoubleTap` | `on` (selector or element) | Two taps within a sub-100 ms window |
| `LongPress` | `on` (selector or element) | Press and hold; resolves to coordinates |
| `InputText` | `into`, `text` | Type into focused field |
| `Swipe` | `from`, `to`, `durationMillis?` | Point-to-point or element-to-element |
| `Scroll` | `direction`, `in?` | Scroll a container up, down, left, or right |
| `PressKey` | `key` | back, home, enter, tab, escape, up, down, left, right |
| `Wait` | `durationMillis` | Sleep for N ms |
## Gaps vs Native Driver
The native driver layer (both `AndroidDriver` and `IOSDriver`) already implements these actions. They are not yet surfaced in Sanderling's action model.
### User Interaction Gaps
| Action | Priority | Notes |
|--------|----------|-------|
| `EraseText` | Medium | Clear N characters from focused field |
| `HideKeyboard` | Medium | Dismiss software keyboard after text input |
| `PasteText` | Low | Paste clipboard content into focused field |
### Device/Environment Gaps
These are less about user gesture modeling and more about test environment setup. Separate decision on whether they belong in the action model.
| Action | Notes |
|--------|-------|
| `SetLocation` | GPS coordinate mocking |
| `SetOrientation` | Portrait, landscape-left, landscape-right |
| `SetAirplaneMode` | Network condition simulation |
| `OpenLink` | Deep links and URLs |
| `AddMedia` | Inject photos or videos into device gallery |
### Out of Scope
These native driver commands don't fit Sanderling's interaction model:
- `LaunchApp`, `StopApp`, `KillApp`, `ClearState` - app lifecycle, handled outside the action stream
- `AssertVisible`, `AssertWithAI` - Sanderling has its own property and assertion model
- `RunScript`, `EvalScript`, `RunFlow`, `Repeat` - Sanderling has its own flow and generator model
- `InputRandomText/Number/Email/...` - Sanderling's `from()` and `weighted()` generators cover this