diff options
author | 2025-02-28 11:19:39 +1100 | |
---|---|---|
committer | 2025-02-28 11:19:39 +1100 | |
commit | dfc30280ba72851e63588dcb7adb8f69721d77a8 (patch) | |
tree | de47d288caacfe1b26d25216ff9700ff00ebf1ca /tests | |
parent | 9d04a405ca0cc25325bbac85e436cbfa5ead2eea (diff) |
Fix RenameDocumentUiTest#testRenameFile_OkButton
For some reason the onView().perform() logic that is present in the
clickDialogOkButton is not clicking the actual button. This is
leading to the test just dismissing the dialog instead of
actioning it. Instead let's update it to use UiObject2 and perform
the click, this seems more stable across Android versions.
Bug: 394151244
Bug: 384582399
Test: atest RenameDocumentUiTest#testRenameFile_OkButton
Flag: EXEMPT Test fix
Change-Id: I6535a023b66506e363d03b121abb60e6b08c5070
Diffstat (limited to 'tests')
-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 4ec75bdc6..b63057185 100644 --- a/tests/common/com/android/documentsui/bots/UiBot.java +++ b/tests/common/com/android/documentsui/bots/UiBot.java @@ -284,7 +284,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.button1)).perform(click()); + UiObject2 okButton = mDevice.findObject(By.res("android:id/button1")); + okButton.click(); } public void clickDialogCancelButton() throws UiObjectNotFoundException { |