thatDoesNotMatchesPrimaryDisplay

fun thatDoesNotMatchesPrimaryDisplay(): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to any non primary display. Convenient to use if you have primary and one secondary display only.

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

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