Skip to content

setDarkMode ​

Enable or disable dark mode to test light and dark UI behavior.

Partial support in Astra Scout

Works on Android devices and emulators and on the iOS Simulator. On an iOS device the command fails, because WebDriverAgent has no way to change the appearance setting.

The setDarkMode command sets the system-wide dark mode (light/dark appearance) state on the device.

INFO

On Android, this toggles the system night mode setting. On iOS, this controls the simulator's system appearance.

Syntax ​

The command takes a single required argument that specifies the desired state for dark mode.

The following example enables dark mode:

yaml
- setDarkMode: enabled

The following example disables dark mode:

yaml
- setDarkMode: disabled