Espresso contrib (
com.android.support.test.espresso:espresso-contrib:2.2.1) openDrawer method is deprecated
then how should I open a drawer?
Here’s an example on how to use the new
The documentation for
openDrawer suggests using the
open method with the correct resource id and perform
Use open() with perform after matching a view. This method will be
removed in the next release.
You can try this out! This will get the menu from toolbar, and press a click on him
onView(allOf(withContentDescription("Menu"), withParent(withId(R.id.toolbar)), isDisplayed())).perform(click());