android / android/android-test

UIScrollable.scrollIntoView- reload data while executed scrollToBeginning in the method

Open
#810 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

### Description
When UIScrollable.getChildByDescription starts working and goes to execute scrollIntoView, first it does scrollToBeginning (which provokes updating of the list if the list is at the beginning), and only then it scrolls down and finds the desired element. How can I disable updating the list if the list is already at the beginning?

### Steps to Reproduce
RecyclerView with the required elements has a parent SwipeRefreshLayout.
Try calling the method UIScrollable.getChildByDescription (or UIScrollable.scrollIntoView) for element in RecyclerView.

### Expected Results
Scrolling is performed until the desired element is found.

### Actual Results
RecyclerView are reloaded and only then scrolling is performed until the required element is found
data reload happens because of this:
https://android.googlesource.com/platform/frameworks/testing/+/f612e6a05f47b28ae0f5715545658c08dd759dd7/uiautomator/library/src/com/android/uiautomator/core/UiScrollable.java#210

Contributor guide

Open the contributing guide

Research direction

Start with UiScrollable.java at the linked scrollToBeginning implementation, then trace UIScrollable.getChildByDescription and scrollIntoView in the reproduction involving RecyclerView inside SwipeRefreshLayout. Confirm whether reaching the beginning triggers a reload, and consider the work complete when the target element is found without an unnecessary data reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.