https://kotlinlang.org logo
Title
m

Max Novikov

03/09/2022, 5:16 AM
Hi all! In our team we are implementing the first feature with Compose. There are ui End to End tests practice in project. When there are compose and view in one Activity we have problem with switching between Espresso and Compose matchers. It looks like compose keeps main thread.
androidx.test.espresso.IdlingResourceTimeoutException: Wait for [Compose-Espresso link] to become idle timed out
I created simple project to reproduce issues: https://github.com/Maksim-Novikov/ComposeUiTestsBug Just run EspressoComposeLinkTest. In real project problems arise when we go back from compose to view, but In sample it begins earlier. I found the only one similar problem, but it associated with infinity animation https://issuetracker.google.com/issues/160259537
l

lsiret

03/14/2022, 8:34 PM
Hi, I got the same problem. The issue was having a ComposeView Gone and a setContent. Try to remove the visibility Gone in your XML and in your setContent and add a If statement in your setContent code @Max Novikov
m

Max Novikov

03/28/2022, 8:09 AM
Thanks for the answer! As I can see, there is already a solution and it will be in 1.2.0 release
z

zsperske

03/30/2022, 11:20 PM
@Max Novikov where did you see there’s a solution coming in 1.2.0? We are facing the problem as you so would love to learn more
m

Max Novikov

03/31/2022, 4:37 AM
z

zsperske

03/31/2022, 5:43 PM
nice it even has a workaround, thank you Max!