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 open
and close
methods:
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.drawer_layout)).perform(DrawerActions.close());
The documentation for openDrawer
suggests using the open
method with the correct resource id and perform ViewAction
.
Use open() with perform after matching a view. This method will be removed in the next release.
http://developer.android.com/reference/android/support/test/espresso/contrib/DrawerActions.html#open(int)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With