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

Espresso doesn't scroll to the view and make it really "visible"

Open jongerrish opened this issue 6 years ago • 3 comments

From: https://issuetracker.google.com/121160135

Hello,

I am testing an app with Espresso in a scenario that there is a NestedScrollView and a banner which is CustomPopupView and it covers the bottom part of the NestedScrollView to tell user some information, and the banner will only show up under some condition. And here comes my problem, when I use Espresso doing scrollTo and click a certain view in that NestedScrollView, it did scroll and the view seems to show up but still covered by the banner which has bigger area than the view to be clicked. So when Espresso perform click, it actually click on the banner view. In the end, the click didn't perform in the way I though.

jongerrish avatar Mar 07 '19 20:03 jongerrish

Happening also in my case, we have a simple scrollView with several row that act as menu items, then at the bottom there's a BottomNavigationView that partially covers the item that needs to be tap. ScrollTo scrolls to the correct view but being partially covered, the click doesn't have any effect.

paolomoschini avatar Oct 16 '20 15:10 paolomoschini

This bug is old, but this is also happening with androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition and related helpers. Even creating my own ViewAction which calls RecyclerView.scrollBy(0, someScrollDownAmount) has no effect when the RecyclerView believes it is at the "bottom" but really it's bottom item is obscured.

I have yet to find a solution.

vitiral avatar Dec 18 '23 19:12 vitiral

Now I'm facing this problem with enabled edge-to-edge. Items of ScrollView actually displayed behind the system navigation bar.

pisanyialeksei avatar May 30 '24 16:05 pisanyialeksei