android - RecyclerView espresso test click() not working -


i faced strange espresso instrumentation test behavior. clicking on recycler view's item not working.

click not happened here:

onview(withid(r.id.recyclerview)).perform(actiononitematposition(0, click())); 

but workaround works:

onview(withid(r.id.recyclerview)).perform(actiononitematposition(0, recyclerclick()));  // ...  public static viewaction recyclerclick() {     return new viewaction() {          @override         public matcher<view> getconstraints() {             return any(view.class);         }          @override         public string getdescription() {             return "performing click() on recycler view item";         }          @override         public void perform(uicontroller uicontroller, view view) {             view.performclick();         }     }; } 

is espresso or recyclerview issue?

should nothing recyclerview specifically. espresso viewactions.click() implementation sending motionevent center of target view. make sure no child intercepts it.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -