[Kautomator] auto-scrolling not working properly in screens with several Scrollables
See original GitHub issueThis happens for example in screens containing several Scrollable views like one “CollapsingToolbarLayout” and a “ScrollView/NestedScrollView/RecyclerView…” e.g. the layout I was using to fix ScrollView with padding: Layout with CollapsingToolbarLayout, HorizontalScrollableView and NestedScrollView
Removing the CollapsingToolbarLayout fixes the issue indeed.
That happens because ObjectAutoScrollProvider uses
val scrollable = UiScrollable(UiSelector().scrollable(true))
That scrolls the first scrollable View, in this cases the CollapsingToolbarLayout!
Possible solution: Enable through Kaspresso builder to pass a UiSelector() for the View we want to autoscroll e.g.
class ObjectAutoScrollProviderImpl(
private val logger: UiTestLogger,
private val autoScrollParams: AutoScrollParams,
private val uiScrollSelector: UiSelector = UiSelector().scrollable(true)
) : AutoScrollProvider<UiObjectInteraction> {
...
val scrollable = UiScrollable(uiScrollSelector)
...
This would give the developer the flexibility for such cases.
Any other suggestion to a better solution is welcome 😃
NOTE: I tested a draft of the proposed solution and it works. I can take this also for 1.4.1 😃
Solution checklist:
- Works with HorizontalScrollView
- Works with any “vertical” scrollable view like NestedScrollView
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (9 by maintainers)
I’m planning to work on the first point this week, which would be easy. The second one is more complex and will require more time, not sure when I’ll find time for it
@sergio-sastre Hi Sergio! Sorry, a lot of work now. Let me check and help you next year (January 5th, 6th) =)