czuckie
11/21/2023, 10:16 AMComposeTestRule
is there a nice way to invoke a customActions
action? I would have thought node.performSemanticsAction
would have been the way in, but currently I'm having to introspect the semantics on a given node and then find the custom actions and manually invoke it which feels a little fragile.czuckie
11/21/2023, 10:18 AM@Test
fun customActionsTest() {
rule.setContent {
Box(modifier = Modifier
.testTag("target")
.clearAndSetSemantics {
customActions = listOf(CustomAccessibilityAction("Custom action label", { TODO("The custom action implementation") }))
}) {
Text("...")
}
}
rule.onNodeWithTag("target").perform[WHAT GOES HERE]
}
given this test, how can I invoke the custom action with 'Custom action label' ?Zach Klippenstein (he/him) [MOD]
11/21/2023, 1:09 PMczuckie
11/21/2023, 1:52 PMczuckie
11/22/2023, 9:32 AM