thatMatchesPrimaryDisplay

fun thatMatchesPrimaryDisplay(): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to primary display.

When obtaining ViewInteraction with onView, pass root matcher to ViewInteraction.inRoot. When obtaining ViewInteraction with waitForView, pass root matcher as an argument. Example:

waitForView(thatIsStopNavigationButton, rootMatcher = thatMatchesPrimaryDisplay())
.check(matches(isDisplayed()))
.perform(click()

onView(thatIsStopNavigationButton)
.inRoot(thatMatchesPrimaryDisplay())
.waitForMatcher(isDisplayed())
.perform(click())