2016-08-06 10 views

答えて

9

は使用pressImeActionButton() ViewActionは、ここで説明:https://developer.android.com/reference/android/support/test/espresso/action/ViewActions.html#pressImeActionButton()

onView(withId(R.id.search_box)) 
    .perform(pressImeActionButton()); 

また、あなたが予想されるIMEアクションが表示されているかどうかを確認するには、ここhttps://developer.android.com/reference/android/support/test/espresso/matcher/ViewMatchers.html#hasImeAction(int)を文書化hasImeAction (int imeAction)を使用することができます。

0
  1. EditTextのレイアウトファイルセットのプロパティandroid:imeOptions="actionSearch"
  2. その後、前の回答を使用します。

    onView(withId(R.id.search_box)) .perform(pressImeActionButton());

関連する問題