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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -