Issue
How can I check that the information of an item inside a ListView is correctly displayed.
I need to check that TODO Title Sample which is an TextView and TODO Location Sample which is also a TextView are correctly displayed with this texts using Espresso. I have the following code, but it is not working:
onData(anything()).inAdapterView(withId(R.id.to_do_list_view)).atPosition(0).
check(matches(withChild(withId(R.id.item_title)).matches(withText("TODO Title Sample"))));
Any idea how I can solve it?
Solution
I was able to figure it out, and it is quite simple:
onData(anything()).inAdapterView(withId(R.id.to_do_list_view)).atPosition(0).
onChildView(withId(R.id.item_title)).
check(matches(withText("TODO Title Sample")));
Answered By - lmiguelvargasf
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.