Closed jebware closed 10 months ago
If you can isolate the issue and suggest a fix or better yet open a PR, that'd be amazing!
As far as I can tell this is a problem with all (or most?) semantics values. With the internal refactor to use Nodes instead of modifiers, the semantic information is now in the Semantics Nodes hierarchy and the information can be accessed without reflection. I have it working by accessing the semanticsOwner
off the RootForTest
interface of the AndroidComposeView
, and then filtering the semantics node by id to match the id of each layout node.
The semantics node data is still backed by a SemanticsConfiguration, so thankfully accessing it doesn't have to change much, but it can no longer be taken from the modifiers list of the ScannableView. I'll put up a PR next week
I've submitted a fix for this at https://github.com/square/radiography/pull/157
Looks like this fix went out in version 2.5 ?
if so, can this be closed?
I just tried it and this is fixed in version 2.5. Thanks!
Radiography is not able to write out the text value of a
Text
composable anymore. To reproduce, you can upgrade the Compose version in this project and run the tests in thecompose-tests
module.Old Compose was writing the text value of the
Text
composable into thetext
value in the semantics, but this is no longer the case. Thetext
value is available in a Modifier node calledTextStringSimpleElement
orTextAnnotatedStringElement
, but those classes are internal in Compose. As a hacky proof of concept, I was able to grab the value using reflection:I'm working with Compose 1.5.1 - I see that the Radiography tests use Compose 1.0.1. I didn't bisect to see when this broke, but I could probably do so, if that would be helpful.
If I come up with a better solution, I'll open a PR.