Shivam Verma
07/01/2024, 3:07 PMclearAndSetSemantics{}
on this node, it is skipped but all other semantic information is also removed and I cannot assert the text content in a test. While this component is not useful for talkback, I'd still like to assert the content in a UI test. What's the recommended way to handle this ?Natasha Jordanovska
07/02/2024, 8:43 AMclearAndSetSemantics
modifier to set a test tag while also ensuring the text is not read by TalkBack. This way, you can still assert the content in a test.
@Composablefun MyComposable() { Column { Text( text = "This text should be skipped by TalkBack", modifier = Modifier .clearAndSetSemantics { testTag = "skippedText" // Set the test tag here// Prevent TalkBack from reading this text } ) Text( text = "This text is visible to TalkBack" ) } }