Package-level declarations

Types

Link copied to clipboard
class RepeatRule(iterations: Int) : TestRule

TestRule to execute tests multiple times. This can be used to debug flaky tests.

Link copied to clipboard
interface RobotActions

Robot actions for performing common view actions.

Link copied to clipboard
interface RobotAssertions

Robot assertions for performing common view assertions.

Link copied to clipboard
abstract class ScreenRobot<out A : RobotActions, out S : RobotAssertions>(robotActions: A, robotAssertions: S)

Base class for implementing a robot DSL.

Functions

Link copied to clipboard
fun Any.asViewAction(delayMillis: Long = DEFAULT_VIEW_ACTION_DELAY_MILLIS)

Convert anything to a ViewAction by looping the main thread for at least delayMillis. This is useful when the trigger of an action isn't a regular Espresso ViewAction e.g. some external events, but needs to participate in Espresso's internal synchronisation mechanisms to prevent the next ViewAction or Matcher from executing too early.

Link copied to clipboard

Clear the scrollFlags on the Toolbar associated with toolbarId.

Link copied to clipboard

Finds the activity in the foreground (if any).

Link copied to clipboard
fun onRecyclerViewIdle(@IdRes recyclerViewId: Int)

Wait until the RecyclerView has no more pending updates.

Link copied to clipboard
fun scrollTo(@IdRes viewId: Int)

Scroll until the view associated with viewId is visible.

fun scrollTo(text: String)

Scroll until the text] is visible.

Link copied to clipboard
fun scrollToItemInRecyclerView(@IdRes recyclerViewId: Int, itemIndex: Int)

Scroll to the item at itemIndex in the RecyclerView associated with recyclerViewId.