java - How to assert inside a RecyclerView in Espresso? -
i using espresso-contrib perform actions on recyclerview
, , works should, ex:
onview(withid(r.id.recycler_view)) .perform(recyclerviewactions.actiononitematposition(0, click())); //click on first item
and need perform assertions on it. this:
onview(withid(r.id.recycler_view)) .perform(recyclerviewactions.actiononitematposition(0, check(matches(withtext("test text"))));
but, because recyclerviewactions is, of course, expecting action, says wrong 2nd argument type. there's no recyclerviewassertions
on espresso-contrib.
is there way perform assertions on recycler view?
you should check out danny roa's solution custom recyclerview actions , use this:
onview(withrecyclerview(r.id.recycler_view) .atpositiononview(1, r.id.ofelementyouwanttocheck)) .check(matches(withtext("test text")));
Comments
Post a Comment