Espresso NestedScrollView

后端 未结 3 1916
不思量自难忘°
不思量自难忘° 2021-01-11 18:41

I am trying to test EditTexts in my form that are within a NestedScrollView. I am running the following code:

onView(withId(R.id.register_scroll_view)).perf         


        
3条回答
  •  春和景丽
    2021-01-11 19:23

    I don't have any experience with NestedScrollView, but it appears that requestRectangleOnScreen(), which is how espresso scrolls in the regular ScrollView, should work with NestedScrollView just the same.

    The only problem is that ScrollView constrain is hardcoded into the scrollTo() action and NestedScrollView doesn't inherit the regular ScrollView.

    I believe the only solution here is to copy and paste entire ScrollToAction class into your own implementation of this action and replace the pesky constrain.

提交回复
热议问题