diff options
author | 2025-03-02 07:23:10 +1100 | |
---|---|---|
committer | 2025-03-02 07:26:03 +1100 | |
commit | b268bdd67ec4da8847f8e17bf07ea7cb4db007cf (patch) | |
tree | 154e0b93b7cbd2bcd41ef486d5b8d739fb39c5be | |
parent | 0525d8ce5c0b15ee3377021d5ad77021fedc3a51 (diff) |
Fix RenameDocumentUitest#testRenameFile_Cancel
For some reason the onView().perform() logic that is present in the
clickDialogCancelButton is not clicking the actual button. This is
leading to the test just leaving the dialog staying on the screen
and the test being unable to find the directoy list. Instead let's
update it to use UiObject2 and perform the click, this seems more
stable across Android versions.
Fix: 385439355
Bug: 394151244
Flag: EXEMPT test fix
Test: atest RenameDocumentUiTest#testRenameFile_Cancel
Change-Id: Ib86d26a2f9c1f1ed24ae9270d4c7b448be9267bc
-rw-r--r-- | tests/common/com/android/documentsui/bots/UiBot.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/common/com/android/documentsui/bots/UiBot.java b/tests/common/com/android/documentsui/bots/UiBot.java index b63057185..161510e2a 100644 --- a/tests/common/com/android/documentsui/bots/UiBot.java +++ b/tests/common/com/android/documentsui/bots/UiBot.java @@ -292,7 +292,8 @@ public class UiBot extends Bots.BaseBot { // Espresso has flaky results when keyboard shows up, so hiding it for now // before trying to click on any dialog button Espresso.closeSoftKeyboard(); - onView(withId(android.R.id.button2)).perform(click()); + UiObject2 okButton = mDevice.findObject(By.res("android:id/button2")); + okButton.click(); } public UiObject findMenuLabelWithName(String label) { |