Hey all, I’m trying to write E2E tests for a compose app that uses a custom tab for login. I’m using
_createAndroidComposeRule_<MyActivity>()
and anytime the test leaves the app to execute the login steps, my activity is destroyed and I get the nasty
Copy code
java.lang.IllegalStateException: No compose hierarchies found in the app
Could anyone who might’ve come across similar issues, give me some ideas on how to resolve this 💩 I could give more context if necessary
f
FranSoto
12/15/2023, 9:31 PM
But when you comeback is you activity there ? recreated ?
a
Alex Yordanov
12/16/2023, 10:11 AM
I guess it is. I’ve actually tried something silly:
Copy code
runBlocking {
delay(5000)
}
and everything worked 🤦♂️ I assume the compose tree needs a bit to get (re)created 🤷♂️ It’s not the most elegant solution but, if it works consistently across multiple runs, it would be fine
f
FranSoto
12/16/2023, 4:51 PM
when u use onNode etc etc internally if fetch all semantics nodes. And without the composable recreated there is literally nothing to fetch and it fails.
i used waitUntil, but is similar to your approach,