Here it is in action:
Espresso Test
@Test
public void clickOnDetailItemShouldDisplayPlayer() {
onView(withId(R.id.container_list)).check(matches(isDisplayed()));
onView(withId(R.id.browse_headers))
.perform(pressKey(KeyEvent.KEYCODE_DPAD_RIGHT));
onView(allOf(isDescendantOfA(withRecyclerView(R.id.row_content).atPosition(0)),
withId(R.id.info_field)))
.perform(pressKey(KeyEvent.KEYCODE_DPAD_CENTER));
onView(withId(R.id.wapo_player_view)).check(matches(isDisplayed()));
}
This test is for an AndroidTV application. It makes sure that the D-Pad navigation from the main header to the nested RecyclerView is functioning as expected. All of the ids for the views were found using uiautomatorviewer.
Hope you found this useful, until next time!
Hope you found this useful, until next time!
No comments:
Post a Comment