KakaoCup / Kakao

Nice and simple DSL for Espresso in Kotlin
https://kakaocup.github.io/Kakao/
Apache License 2.0
324 stars 28 forks source link

Make ScrollViewActions support horizontal and nested scroll views #103

Closed Nikitae57 closed 9 months ago

Nikitae57 commented 9 months ago

Blind fix, I didn't test it. Trying to fix exception below when trying to scroll to end NestedScrollView. While I'm at it, added HorizontalScrollVIew

<androidx.core.widget.NestedScrollView
    android:id="@+id/nested_scroll">
    ...
</androidx.core.widget.NestedScrollView
val scroll = KScrollView { withId(R.id.nested_scroll) }

scroll {
    scrollToEnd()
}
androidx.test.espresso.PerformException: Error performing 'Scroll ScrollView to end' on view '(view.getId() is <...id/nested_scroll>)'.
Caused by: java.lang.RuntimeException: Action will not be performed because the target view does not match one or more of the following constraints:
(is assignable from class <class android.widget.ScrollView> and (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() to return non-empty rectangle))
Vacxe commented 9 months ago

Thanks for the contribution. Could you please add UI tests for each case?