StrikekitStrikekit

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

ItemContract
Element / control shapeAfter general resolve, control must be checkable / switch-like: input checkbox/radio, or role=checkbox / switch / radio, or a checked boolean property
How the label bindsFull general resolve (fill → click → checkbox candidates)
Qualifiers that change resolveOptional by …
PlatformWeb only (v1)
Wrong shape → use insteadNon-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 checked

Notes

  • 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.

On this page