Maestro supports Jetpack Compose.
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"
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"
{% content-ref url="broken-reference" %} Broken link {% endcontent-ref %}