Alexandru Gheorghe
06/13/2024, 2:42 PM.testTag
that is part of another composable that gets called by a top level composable which gets called in MainActivity
? I get an error stating said tagged composable is in the subtree and not in the main one used for discovering nodes.Alexandru Gheorghe
06/13/2024, 2:45 PM@Composable
fun TopLevelComposable() {
AComposable()
}
@Composable
fun AComposable() {
Text(text = "stringOfText", modifier = Modifier.testTag("Text of AComposable"))
}
Testing Text(...)
throws error.Alexandru Gheorghe
06/14/2024, 9:29 AMjava.lang.AssertionError: Failed: assertExists.
Reason: Expected exactly '1' node but could not find any node that satisfies: (TestTag = '<STRING HERE>')
However, the unmerged tree contains '1' node that matches. Are you missing `useUnmergedNode = true` in your finder?