lightbulb_outline Please take our October 2018 developer survey. Start survey

NavigationViewActions

public final class NavigationViewActions
extends Object

java.lang.Object
   ↳ androidx.test.espresso.contrib.NavigationViewActions


View actions for interacting with NavigationView

Summary

Public methods

static ViewAction navigateTo(int menuItemId)

Returns a ViewAction that navigates to a menu item in NavigationView using a menu item resource id.

Inherited methods

From class java.lang.Object

Public methods

navigateTo

ViewAction navigateTo (int menuItemId)

Returns a ViewAction that navigates to a menu item in NavigationView using a menu item resource id.

View constraints:

  • View must be a child of a DrawerLayout
  • View must be of type NavigationView
  • View must be visible on screen
  • View must be displayed on screen

      Parameters
      menuItemId int: the resource id of the menu item

      Returns
      ViewAction a ViewAction that navigates on a menu item