When using the `ComposeTestRule` is there a nice w...
# compose
c
When using the
ComposeTestRule
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.
1
Copy code
@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' ?
z
Feel free to file a feature request
c
will do!
https://issuetracker.google.com/issues/312491159 I have a feeling I raised it wrong (suddenly I have sympathy for my parents)
😅 1