toggle
Toggle a labeled checkbox or switch-like control
Toggle a checkable / switch-like control once (click after resolve). Prefer this when authors want clearer intent than a plain click.
Syntax
When I toggle "<label>" [by …]Requirements
| Item | Contract |
|---|---|
| Element / control shape | After general resolve, control must be checkable / switch-like: input checkbox/radio, or role=checkbox / switch / radio, or a checked boolean property |
| How the label binds | Full general resolve (fill → click → checkbox candidates) |
| Qualifiers that change resolve | Optional by … |
| Platform | Web only (v1) |
| Wrong shape → use instead | Non-checkable control → click on if it is a button/link |
When it fails
element is not checkable or switch-like— wrong control type after resolve.- Not found / timeout — label missed.
See also UI contracts.
Examples
When I toggle "Dark mode"
Then I should have "Dark mode" be checkedNotes
- Uses action resolve auto-wait (~30s).
- Fails if the resolved control is not checkable / switch-like.
- Often interchangeable with
click on+should have … be checked. - Web only for v1.