Skip to content

Instantly share code, notes, and snippets.

@flipper83
Created September 28, 2017 10:21
Show Gist options
  • Save flipper83/97342aaa168fab8b75d86c2b50caaae2 to your computer and use it in GitHub Desktop.
Save flipper83/97342aaa168fab8b75d86c2b50caaae2 to your computer and use it in GitHub Desktop.
@Test public void openSuperHeroDetailScreenWhenClickInARow() {
List<SuperHero> superHeroes = givenSomeSuperHeroes(ANY_NUMBER);
int indexSuperHeroClick = 0;
startActivity();
onView(withId(R.id.recycler_view)).perform(
RecyclerViewActions.actionOnItemAtPosition(indexSuperHeroClick, click()));
SuperHero superHero = superHeroes.get(indexSuperHeroClick);
intended(hasComponent(SuperHeroDetailActivity.class.getCanonicalName()));
intended(hasExtra("super_hero_name_key", superHero.getName()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment