Switchvariable
Call this InteractorConstructor to initialize a switch Interactor.
The switch interactor can be used to interact with switches on the page and
to assert on their state.
The switch is located by the text of its label or by aria-label attribute.
Example
await Switch('Theme').toggle();
await Switch('Theme').is({ disabled: true });
await Switch({ id: 'theme-toggler', disabled: true }).exists();
Filters
title: string – Filter by titleid: string – Filter by idvisible: boolean – Filter by visibility. Defaults totrue. SeeisVisible.valid: boolean – Filter by whether the switch is valid.checked: boolean – Filter by whether the switch is checked..disabled: boolean – Filter by whether the switch is disabled. Defaults tofalse.focused: boolean – Filter by whether the switch is focused. Seefocused.
Actions
click():Interaction– Click on the switchfocus():Interaction– Focus the switchblur():Interaction– Blur the switchcheck():Interaction– Check the switch if it is not checkeduncheck():Interaction– Uncheck the switch if it is checkedtoggle():Interaction– Toggle the switch