Espresso Bottle Tests

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.

+5
source share
1 answer

Espresso launches your activity but cannot find any view with id content_loading_progress_bar. This problem does not come from Espresso, but from your test.

Make sure you start the right job correctly. Also, regarding the AWS device farm and your tests with Espresso, I suggest you follow this template . But be careful that it runs on AWS Device Farm, all of your test methods must start with "testXYZ ()" or the farm will not detect them.

-1
source

Source: https://habr.com/ru/post/1233508/


All Articles