Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcfbaa6b authored by Kohsuke Yatoh's avatar Kohsuke Yatoh
Browse files

Use case-insensitive match for action label.

The label can be as-is ("Test reply") or all-caps ("TEST REPLY")
depending on the system config.

Bug: 227712564
Bug: 227424350
Test: atest InputMethodStressTest
Change-Id: Id64793f572bec06c84a235fc7688870f44013723
parent f75e0a05
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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();