thatMatchesSpecificDisplay

fun thatMatchesSpecificDisplay(displayId: DisplayId): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to display with the given displayId.

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 = thatMatchesSpecificDisplay(...))
.check(matches(isDisplayed()))
.perform(click()

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