Hey everyone, I’m getting a false negative result for one of my tests. - `assertIsDisplayed` works...
g
Hey everyone, I’m getting a false negative result for one of my tests. •
assertIsDisplayed
works fine for
Content1
and
Content2
but it fails for
Content3
• I tried with
useUnmergedTree=true/false
, no luck •
assertExists
works and I can see the node in the printed debug tree. • Making the column scrollable also works, but not sure if that’s the best way to approach this. • I debugged into
SemanticsNodeInteraction.checkIsDisplayed()
and
node.boundsInWindow
is 0 for
Content3
Thank you!
Copy code
Column(
        verticalArrangement = Arrangement.spacedBy(8.dp),
        modifier = Modifier
            .background(Color.White)
    ) {
        Content1(modifier = Modifier.testTag("content1"))
        Content2(modifier = Modifier.testTag("content2"))
        Content3(modifier = Modifier.testTag("content3"))
    }
v
is Content3 visible in the viewport?
g
Yes. In the app and in the Preview it is visible
j
Did you run the test in debug mode with a breakpoint on that assertion, to make sure that on your test device it indeed shows as expected?
g
Yes. I have a sample app and this is used in two places in the sample app, where everything looks normal. I did run the test in debug mode and that’s how I found out that
boundsInWindow
is 0.
j
Ah yes, I was reading too fast. Might be useful to try to create a minimum reproducible code sample and raise an issue in the tracker!
g
I will do that