diff --git a/androidTest/java/org/aprsdroid/app/FirstRunDialog.java b/androidTest/java/org/aprsdroid/app/FirstRunDialog.java index 89471de5..8772f423 100644 --- a/androidTest/java/org/aprsdroid/app/FirstRunDialog.java +++ b/androidTest/java/org/aprsdroid/app/FirstRunDialog.java @@ -2,6 +2,7 @@ import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; import static androidx.test.espresso.action.ViewActions.typeText; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -50,10 +51,10 @@ public void givenAFirstTimeRun_whenProvidedABadPasscode_ThenDialogStaysOpen() { hasDescendant(withId(R.id.passcode))))); onView(withId(R.id.callsign)) .check(matches(withHint(containsString("Callsign")))) - .perform(typeText("XA1AAA")); + .perform(closeSoftKeyboard(), typeText("XA1AAA")); onView(withId(R.id.passcode)) .check(matches(withHint(containsString("Passcode")))) - .perform(typeText("12345")); + .perform(closeSoftKeyboard(), typeText("12345")); onView(withId(android.R.id.button1)).perform(click()); // OK Button onView(isRoot()) .inRoot(isDialog()) @@ -78,10 +79,10 @@ public void givenAFirstTimeRun_whenProvidedAGoodPasscode_ThenDialogCloses() { hasDescendant(withId(R.id.passcode))))); onView(withId(R.id.callsign)) .check(matches(withHint(containsString("Callsign")))) - .perform(typeText("XA1AAA")); + .perform(closeSoftKeyboard(), typeText("XA1AAA")); onView(withId(R.id.passcode)) .check(matches(withHint(containsString("Passcode")))) - .perform(typeText("23459")); + .perform(closeSoftKeyboard(), typeText("23459")); onView(withId(android.R.id.button1)).perform(click()); // OK Button onView(allOf( isRoot(), @@ -100,10 +101,10 @@ public void givenAFirstTimeRun_whenProvidedAGoodPasscode_ThenPrefsSaved() { Assert.assertNull("Passcode", prefs.getString(pref_passcode, null)); onView(withId(R.id.callsign)) .check(matches(withHint(containsString("Callsign")))) - .perform(typeText(expected_callsign)); + .perform(closeSoftKeyboard(), typeText(expected_callsign)); onView(withId(R.id.passcode)) .check(matches(withHint(containsString("Passcode")))) - .perform(typeText(expected_passcode)); + .perform(closeSoftKeyboard(), typeText(expected_passcode)); onView(withId(android.R.id.button1)).perform(click()); // OK Button Assert.assertEquals("Callsign", expected_callsign, prefs.getString(pref_callsign, null)); Assert.assertEquals("Passcode", expected_passcode, prefs.getString(pref_passcode, null));