android / android/android-test

RecyclerVIewActions.actionOnItem do not throw PerformException with cause AmbiguousViewMatcherException in case when unique recycler item have more than one matched view

Open
#1,219 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
342
Avg merge
11h 29m
Merged PRs (30d)
2

Description

### Preconditions:
- RecyclerView.itemsCount = 1
- Recyclerview have item with 2 TextViews and each TextView have text "Test"

### Steps to Reproduce
run code

`onView(withId(R.id.recyclerView)).perform(RecyclerVIewActions.actionOnItem(hasDescendant(withText("Test")), click()))`

### Expected Results
code throw PerformException with cause `AmbiguousViewMatcherException`, becouse matcher` hasDescendant(withText("Test"))` matches 2 TextViews

### Actual Results
code not throw `PerformException `with cause `AmbiguousViewMatcherException`, test passed without any errors

### AndroidX Test and Android OS Versions
androidx.test.espresso:espresso-core:3.4.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the provided RecyclerViewActions.actionOnItem snippet using AndroidX Espresso 3.4.0, then inspect the implementation of RecyclerViewActions.actionOnItem and its matching behavior. Done means the same setup throws PerformException with AmbiguousViewMatcherException as its cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.