Skip to content

Instantly share code, notes, and snippets.

@kozmi55
Created October 20, 2017 11:29
Show Gist options
  • Save kozmi55/64682710eacc7c167685c93470679248 to your computer and use it in GitHub Desktop.
Save kozmi55/64682710eacc7c167685c93470679248 to your computer and use it in GitHub Desktop.
@Test
fun testOpenDetailsOnItemClick() {
mockRepoUsers(1)
activityRule.launchActivity(Intent())
Espresso.onView(ViewMatchers.withId(R.id.recyclerView))
.perform(RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(0, ViewActions.click()))
val expectedText = "User 1: 100 pts"
Espresso.onView(Matchers.allOf(ViewMatchers.withId(android.support.design.R.id.snackbar_text), ViewMatchers.withText(expectedText)))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment