hi Compose experts. With the release of the Compos...
# compose
m
hi Compose experts. With the release of the Compose date picker in material 3 version 1.1.0, should I expect to be able to select dates from a UI test? Nothing shows up in the layout inspector to click on. Is there another way I’m supposed to be doing it?
c
I've not personally tried, but a few go-to-tricks I like to use when I'm pulling my hair out are: •
rule.onRoot().printToString(...)
- lets me see the hierarchy of composables the test framework can see •
rule.onRoot(useUnmergedTree = true).printToString(...)
let's me see if there are things I can select against when the
mergeDescendants
modifier is ignored I wish I had more tricks, but 😞
m
yeah I actually tried that already too. for some reason it doesn’t actually print anything if I’ve opened the datepicker. thanks anyway. I would have thought if it was stable now that it would be visible in the layout inspector so we can click on stuff in the UI tests.
c
hmm, maybe try:
rule.onAllNodes(isRoot()).printToString(...)
or maybe
rule.onAllNodes(isDialog()).printToString(...)
I've not actually used the date picker so I have no idea how it's implemented 😞
m
I think it’s just not supported yet for testing. a bit weird. every composable should be visible in the layout inspector for anything we can click on.