Riz*_*ono 8 android android-espresso
如何在Espresso Test Android Studio中按下软键盘模拟器上的"搜索按钮"?它位于右下方.
spl*_*tte 16
使用pressImeActionButton()此处记录的ViewAction:https://developer.android.com/reference/android/support/test/espresso/action/ViewActions.html#pressImeActionButton()
onView(withId(R.id.search_box))
.perform(pressImeActionButton());
Run Code Online (Sandbox Code Playgroud)
此外,您可以使用hasImeAction (int imeAction)此处记录的https://developer.android.com/reference/android/support/test/espresso/matcher/ViewMatchers.html#hasImeAction(int)来检查是否显示了预期的IME操作.
| 归档时间: |
|
| 查看次数: |
3096 次 |
| 最近记录: |