Hey all, I’m trying to write E2E tests for a compo...
# android
a
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
But when you comeback is you activity there ? recreated ?
a
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
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,