Flutter

Maestro supports Flutter.
Commands such as tapOn provide you with ways to select these widgets based on text or semantic labels.

Interacting with Widgets by Text

Maestro can interact with widgets that have some displayed text (data in the Text widget, hintText in the TextField).

Example: Tap on a InkWell widget

Given an InkWell widget with a Text widget child:
InkWell(
child: const Text('Open Browser'),
onTap: () => launch('')
)
The following command will tap on the InkWell widget:
- tapOn: "Open Browser"

Example: Tap on TextFormField

For the following widget:
TextFormField(
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Enter your username'
)
)
The following command will tap on the TextFormField:
- tapOn: "Enter your username"

Interacting with Widgets by semantic label

Widgets can be interacted with via semanticLabel property.

Example: Tap on FloatingActionButton

For the following widget:
FloatingActionButton(
onPressed: _incrementCounter,
child: const Icon(Icons.add, semanticLabel: "fabAddIcon"),
)
The following command will tap on the FloatingActionButton
- tapOn: "fabAddIcon"

Known Limitations

There are known limitations
  1. 1.
    In cases where there are both semanticLabel and text label, the semanticLabel takes precedence. It's recommended to use maestro studio to identify accessibility labels.
  2. 2.
    Interaction on the basis of key is currently not possible.
  3. 3.
    Maestro cannot be used to test desktop or web apps (yet).