class DrawerActions


Espresso actions for using a DrawerLayout.

See Navigation drawer design guide

Summary

Public functions

java-static ViewAction!

Creates an action which closes the DrawerLayout with gravity START.

java-static ViewAction!
close(gravity: Int)

Creates an action which closes the DrawerLayout with the gravity.

java-static Unit
closeDrawer(drawerLayoutId: Int)

This function is deprecated.

Use close with perform after matching a view.

java-static Unit
closeDrawer(drawerLayoutId: Int, gravity: Int)

This function is deprecated.

Use open with perform after matching a view.

java-static ViewAction!

Creates an action which opens the DrawerLayout drawer with gravity START.

java-static ViewAction!
open(gravity: Int)

Creates an action which opens the DrawerLayout drawer with the gravity.

java-static Unit
openDrawer(drawerLayoutId: Int)

This function is deprecated.

Use open with perform after matching a view.

java-static Unit
openDrawer(drawerLayoutId: Int, gravity: Int)

This function is deprecated.

Use open with perform after matching a view.

java-static ViewAction!

Creates an action that will wait for the drawer to close.

Public functions

close

java-static fun close(): ViewAction!

Creates an action which closes the DrawerLayout with gravity START. This method blocks until the drawer is fully closed. No operation if the drawer is already closed.

close

java-static fun close(gravity: Int): ViewAction!

Creates an action which closes the DrawerLayout with the gravity. This method blocks until the drawer is fully closed. No operation if the drawer is already closed.

closeDrawer

java-static fun closeDrawer(drawerLayoutId: Int): Unit

closeDrawer

java-static fun closeDrawer(drawerLayoutId: Int, gravity: Int): Unit

open

java-static fun open(): ViewAction!

Creates an action which opens the DrawerLayout drawer with gravity START. This method blocks until the drawer is fully open. No operation if the drawer is already open.

open

java-static fun open(gravity: Int): ViewAction!

Creates an action which opens the DrawerLayout drawer with the gravity. This method blocks until the drawer is fully open. No operation if the drawer is already open.

openDrawer

java-static fun openDrawer(drawerLayoutId: Int): Unit

openDrawer

java-static fun openDrawer(drawerLayoutId: Int, gravity: Int): Unit

waitForClose

java-static fun waitForClose(): ViewAction!

Creates an action that will wait for the drawer to close. Use this in cases where the closing of the drawer is implicit, such as selecting an item in the drawer. No operation if the drawer is closed. This uses an idling resource to wait for close, so it will fail if it does not close within the idling resource timeout.