Closed fknives closed 2 years ago
Additional notes to add to SharedTests:
ShadowDialog.getLatestDialog()
can be used. So the solution is to have a DialogVerification class, to interact with dialogs, which uses Espresso on AndroidTests and ShadowDialog in Robolectric TestrunBlocking { withContext(Dispatcher.IO) { mockwebserver.url("/") } }
. reference = https://github.com/square/okhttp/issues/3184activityScenario.onActivity{
which runs on main thread.Mention also the Pointer location developer options when dealing with touch events
Don't forget to mention the issue with ProgressBars with Espresso: namely that progressbar and other infinite loading indicators will make the MainThread not Idle, thus Espresso actions lock up, Reference: https://stackoverflow.com/questions/30469240/java-lang-runtimeexception-could-not-launch-intent-for-ui-with-indeterminate https://stackoverflow.com/questions/35186902/testing-progress-bar-on-android-with-espresso
All original links provided in reference are outdated sadly