onView(withId(R.id.payButton)).perform(click()) onView(isRoot()).perform( waitUntil( allOf( withId(R.id.receiptTitle), withText("Receipt"), isDisplayed() ) ) ) onView(withId(R.id.receiptTitle)).check(matches(withText("Receipt")))