https://kotlinlang.org logo
#compose
Title
# compose
c

czuckie

11/21/2023, 10:16 AM
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

Zach Klippenstein (he/him) [MOD]

11/21/2023, 1:09 PM
Feel free to file a feature request
c

czuckie

11/21/2023, 1:52 PM
will do!
https://issuetracker.google.com/issues/312491159 I have a feeling I raised it wrong (suddenly I have sympathy for my parents)
😅 1