Issue
I want to make an assertion with Espresso over several views. For example, I want to check that all the rows of a listview are checked, and I don't want to check each row one by one (I could have 100 items in my list). So, can I do something to perform an assertion over multiples views? I cant't find the way to do this.
Solution
ListView
holds only certain amounts of views, not to the number of data you have provided. At time you can have, let's say 10 items displayed and 90 not displayed.
- You should get item count in with onData();
- Iterate from
0
toitemCount
perform scrolling to that position - Assert for each view
atPosition(index)
Answered By - Nikola Despotoski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.