Android - Jetpack Compose

Maestro supports Jetpack Compose.

Interacting with composable with Text

Given a composable with a displayed text:
Text(
text = "Like",
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold
)
You can use the following command to tap on this Text :
- tapOn: "Like"

Interacting with composable with Accessibility

Given a composable without text, you can use semantics:
For the following composable:
FloatingActionButton(onClick = onClick,
modifier = Modifier
.semantics { testTagsAsResourceId = true }.testTag("Add")
) {
Icon(Icons.Filled.Add, "")
}
You can tap on this using testTag:
- tapOn:
id: "Add"

Resources