Skip to content

Instantly share code, notes, and snippets.

@flipper83
Last active September 28, 2017 09:06
Show Gist options
  • Save flipper83/507fb4e6f7f743c43604ea9f95f52b7a to your computer and use it in GitHub Desktop.
Save flipper83/507fb4e6f7f743c43604ea9f95f52b7a to your computer and use it in GitHub Desktop.
@Test public void showsSuperHeroesNameWhenThereAreSomeSuperHeroes() {
final List<SuperHero> superHeroes = givenSomeSuperHeroes(ANY_NUMBER);
startActivity();
RecyclerViewInteraction.<SuperHero>onRecyclerView(withId(R.id.recycler_view)).withItems(
superHeroes
.check(new RecyclerViewInteraction.ItemViewAssertion<SuperHero>() {
@Override
public void check(SuperHero superHero, View view, NoMatchingViewException exception) {
matches(hasDescendant(withText(superHero.getName()))).check(view, exception);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment