Issue
I am trying to get the recycle view using onData but i am stuck in this error:
No views in hierarchy found matching: is assignable from class: class android.widget.AdapterView
The code is just this:
onData(allOf(isAssignableFrom(RecyclerView.class), withId(R.id.ce_musers_list)))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
My adaptor extends RecyclerView.Adapter
as it should for a RecycleView, yet, seams the matcher is looking for a simple Adapter.
This is my first time with espress, so i may be failing in something basic.
My Espresso version is 3.0.0
Solution
onData()
is used only with the AdapterView
and its subclasses, which RecyclerView does not belong to.
There is a helper class that espresso comes with: RecyclerViewActions that can be used to perform various actions on a recyclerview and itemviews of the viewholders.
For instance, if you want to make an assertion - you can scroll to the itemview and then use regular onView()...
to check particulars of that viewholder.
Answered By - Be_Negative
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.