android-test icon indicating copy to clipboard operation
android-test copied to clipboard

RecyclerVIewActions.actionOnItem incorrect PerformExceprionCause when matched 0 or more than 1 item

Open almaz010891 opened this issue 4 years ago • 0 comments

Description

RecyclerVIewActions.actionOnItem incorrect PerformExceprionCause when matched 0 or more than 1 item

Steps to Reproduce

RecyclerView have more than 1 item with matcher, for example:

onView(withId(R.id.recycler_view).perform(RecyclerViewActions.actionOnItem(isDisplayed(), click()))

If RecyclerView have 2 or more items, this code throws PerformException, but PerformException.cause is RuntimeException instead of AmbiguousViewMatcherException

Same situation when RecyclerView does not have any item with matcher, for example (all RecyclerView items is displayed):

onView(withId(R.id.recycler_view).perform(RecyclerViewActions.actionOnItem(not(isDisplayed()), click()))

this code throws PerformException, but PerformException.cause is RuntimeException instead of NoMatchingViewException

AndroidX Test and Android OS Versions

androidx.test.espresso:espresso-core:3.4.0

almaz010891 avatar Nov 25 '21 08:11 almaz010891