diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java index 31f00c692cdcf..29c52cf8cb6a9 100644 --- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java +++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java @@ -48,6 +48,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; @RootPermissionTest @RunWith(AndroidJUnit4.class) @@ -99,7 +100,9 @@ public final class NotificationTest { public void testDirectReply() { postMessagingNotification(); mUiDevice.openNotification(); - mUiDevice.wait(Until.findObject(By.text(REPLY_ACTION_LABEL)), TIMEOUT).click(); + // The text can be shown as-is, or all-caps, depending on the system. + Pattern actionLabelPattern = Pattern.compile(REPLY_ACTION_LABEL, Pattern.CASE_INSENSITIVE); + mUiDevice.wait(Until.findObject(By.text(actionLabelPattern)), TIMEOUT).click(); // Verify that IME is visible. assertThat(mUiDevice.wait(Until.findObject(By.pkg(getImePackage(mContext))), TIMEOUT)) .isNotNull();