diff options
author | Alison Cichowlas <asc@google.com> | 2018-05-18 19:29:48 -0400 |
---|---|---|
committer | Alison Cichowlas <asc@google.com> | 2018-05-18 19:48:44 -0400 |
commit | e863a4546f3d1f5fb5c779b6e3058a31acc1db29 (patch) | |
tree | 90d7424f5a07e60556251cb96ac0501d48f882a7 | |
parent | a4d46299117f3ed7d383785ede7b547fe296928c (diff) | |
download | platform_testing-e863a4546f3d1f5fb5c779b6e3058a31acc1db29.tar.gz |
ClearAll and Reply jank test fix.
Clear All was case-sensitive, changing the button from
"CLEAR ALL" to "Clear All" broke it. Let's use a more flexible
matcher in hopes of not collapsing during the next paint job.
Reply looked for the visible text of the button, which was
removed in favor of just an icon. Let's peek at the accessibility
text instead to identify this button.
Bug: 79201770
Test: runtest --path platform_testing/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java
Change-Id: I97c7177a173852b260cfa0d1433106eccb3da32d
-rw-r--r-- | tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java b/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java index 833f90874..7b144aa4d 100644 --- a/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java +++ b/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java @@ -112,6 +112,9 @@ public class SystemUiJankTests extends JankTestBase { */ private static final int GROUP_MODE_UNGROUPED = 2; + private final UiSelector clearAllSelector = + new UiSelector().className(Button.class).descriptionContains("CLEAR ALL"); + private UiDevice mDevice; private ArrayList<String> mLaunchedPackages; private NotificationManager mNotificationManager; @@ -205,8 +208,7 @@ public class SystemUiJankTests extends JankTestBase { mDevice.waitForIdle(); // CLEAR ALL might not be visible in case we don't have any clearable notifications. - UiObject clearAll = - mDevice.findObject(new UiSelector().className(Button.class).text("CLEAR ALL")); + UiObject clearAll = mDevice.findObject(clearAllSelector); if (clearAll.exists()) { clearAll.click(); } @@ -589,8 +591,7 @@ public class SystemUiJankTests extends JankTestBase { afterTest = "afterClearAll") @GfxMonitor(processName = SYSTEMUI_PACKAGE) public void testClearAll() throws Exception { - UiObject clearAll = - mDevice.findObject(new UiSelector().className(Button.class).text("CLEAR ALL")); + UiObject clearAll = mDevice.findObject(clearAllSelector); while (!clearAll.exists()) { scrollDown(); } @@ -828,7 +829,8 @@ public class SystemUiJankTests extends JankTestBase { afterTest = "afterInlineReply") @GfxMonitor(processName = SYSTEMUI_PACKAGE) public void testInlineReply() throws Exception { - UiObject2 replyButton = mDevice.findObject(By.clazz(Button.class).text(REPLY_TEXT)); + UiObject2 replyButton = mDevice.findObject( + By.clazz(Button.class).descStartsWith(REPLY_TEXT)); assertNotNull("Could not find button with text '" + REPLY_TEXT + "'.", replyButton); for (int i = 0; i < INNER_LOOP; i++) { replyButton.click(); |