我正在尝试编写一个Espresso测试,以在自定义SearchView中输入文本。 自定义SearchView如下:
https://github.com/MiguelCatalan/MaterialSearchView/tree/develop/library/src/main/res/layout
我正在我的MainActivity中使用它。如果我直接在这个SearchView上调用'typeText',它会抛出一个错误,因为我实际上需要从这个搜索栏中获取EditText。
EditText在search_view.xml中。
我认为Espresso命令应该是:
onView(get EditText from SearchView).perform(typeText("chicken"));
我该如何获取EditText的引用?