Espresso doesn't scroll to the view and make it really "visible"
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.
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.
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.
Now I'm facing this problem with enabled edge-to-edge. Items of ScrollView actually displayed behind the system navigation bar.