I don’t know why espresso with breaks cannot find clearly visible elements. He does not work:
failed: android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with id: com.justyoyo.staging.debug:id/content_loading_progress_bar
This is frustrating because it doesn’t matter if I run tests on local physical devices, the AWS device farm, or on Genymotion emulators. It also doesn't matter that I add an explicit wait SystemClock.sleep(5000); before checking if an item is visible. I work normally 2.3 times in a row, then it fails.
To give you more information, we use a dagger, a mortar, and we run tests in the user interface stream, since working on them at a separate level was even worse.
source share