Advanced Espresso - Google I/O 2016
Why Stack Overflow recommends it
Stack Overflow users link it when answering Espresso questions about custom matchers, discouraged patterns like conditional clicks, and why to use idling or main-thread looping instead of Thread.sleep.
Recommended by 1 people across 1 different months, 2016 to 2019.
What it is
A Google I/O 2016 session from the Android team on going beyond the basics of Espresso, Android's UI testing framework. It covers best practices and advanced API usage for handling complex functional test scenarios, aimed at both existing Espresso users and newcomers.
What people said
Recommends Bohsen · 2017-10 · Stack Overflow · on “What is the difference between bounded matcher and type safe matcher in espresso?”
They are very similar. Both are a common type of matcher that you can extend and often they can be used for the same job. But there's one difference that you should always be aware of. TypeSafeMatcher originates from the hamcrest library and is a more general type of matcher. With this type of matcher you should always check the type of whatever you are asserting against. If the type check passes (ie. view instanceOf TextView), you continue your assertions. BoundedMatcher is a class from the Android Test Support Library and is a convenience class that does the typecheck for you. As suggested by @humblerookie there's an excellent explanation here [this video] .
Cites Sahith Reddy · 2016-06 · Stack Overflow · on “Android Espresso - Click checkbox if not checked”
That is not recommended according to Google it goes against how Espresso works and is very dangerous [this video]
Cites Big McLargeHuge · 2019-05 · Stack Overflow · on “How is uiController.loopMainThreadForAtLeast different from Thread.sleep?”
In this video from Google I/O 2016 [this video] , Wojtek Kaliciński recommends using uiController.loopMainThreadForAtLeast instead of Thread.sleep in Espresso tests. Granted, the context is around Idling Resources, but what's the difference between the two and why is one better than the other?