From d340d76cd1f7b9b0cf9f0d0b05b64596c3917c7b Mon Sep 17 00:00:00 2001 From: Ahmad Vazirna Date: Sun, 7 Jun 2026 19:25:41 +0200 Subject: [PATCH 1/4] CaseClaimTest.testCaseClaimByDifferentUser() - wait for case search results --- .../src/org/commcare/androidTests/CaseClaimTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/instrumentation-tests/src/org/commcare/androidTests/CaseClaimTest.java b/app/instrumentation-tests/src/org/commcare/androidTests/CaseClaimTest.java index 230494f01b..1c49864bf6 100644 --- a/app/instrumentation-tests/src/org/commcare/androidTests/CaseClaimTest.java +++ b/app/instrumentation-tests/src/org/commcare/androidTests/CaseClaimTest.java @@ -20,9 +20,11 @@ import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; import static androidx.test.espresso.matcher.ViewMatchers.withClassName; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static org.commcare.utils.InstrumentationUtility.waitForView; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.endsWith; @@ -126,6 +128,8 @@ public void testCaseClaimByDifferentUser() { .perform(click()); // Close the new case of cordelia with this user. + onView(withId(R.id.screen_entity_select_list)) + .perform(waitForView(withText(name), 10000, true)); onView(withText(name)) .perform(click()); onView(withText("Continue")) From 216ac7e3c57dbe1d8e80b3582ab199a57d294564 Mon Sep 17 00:00:00 2001 From: Ahmad Vazirna Date: Mon, 8 Jun 2026 14:25:51 +0200 Subject: [PATCH 2/4] testLoginFlow_withoutInternet - Ensure Wi-Fi is disabled before login offline --- .../src/org/commcare/androidTests/LoginTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/instrumentation-tests/src/org/commcare/androidTests/LoginTest.kt b/app/instrumentation-tests/src/org/commcare/androidTests/LoginTest.kt index e7ffc5b0ea..909dbd4e57 100644 --- a/app/instrumentation-tests/src/org/commcare/androidTests/LoginTest.kt +++ b/app/instrumentation-tests/src/org/commcare/androidTests/LoginTest.kt @@ -101,6 +101,7 @@ class LoginTest: BaseTest() { InstrumentationUtility.logout() // login offline with bad password + InstrumentationUtility.changeWifi(false) InstrumentationUtility.login("user_with_no_data", "badpass") onView(withText("Either the password you entered was incorrect, or CommCare couldn't reach the server")) .check(matches(isDisplayed())) From 674cddae1dcfa04676c5b3aabc302a991e00b843 Mon Sep 17 00:00:00 2001 From: Ahmad Vazirna Date: Wed, 10 Jun 2026 18:24:11 +0200 Subject: [PATCH 3/4] testCannotSaveBlankSignatures() - sleep after returning from an exit attempt --- .../src/org/commcare/androidTests/SignatureTests.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/instrumentation-tests/src/org/commcare/androidTests/SignatureTests.kt b/app/instrumentation-tests/src/org/commcare/androidTests/SignatureTests.kt index 5a68d2f0b1..314e2f4e74 100644 --- a/app/instrumentation-tests/src/org/commcare/androidTests/SignatureTests.kt +++ b/app/instrumentation-tests/src/org/commcare/androidTests/SignatureTests.kt @@ -15,6 +15,7 @@ import org.commcare.annotations.BrowserstackTests import org.commcare.utils.InstrumentationUtility import org.commcare.views.DrawView import org.commcare.dalvik.R +import org.commcare.utils.InstrumentationUtility.sleep import org.commcare.utils.doesNotExist import org.commcare.utils.isDisplayed import org.hamcrest.Matchers @@ -127,6 +128,7 @@ class SignatureTests: BaseTest() { Espresso.pressBack() withText(R.string.keep_changes).doesNotExist() Espresso.pressBack() + sleep(1) } /** From 2b79c629b9f1e0729785a6a4ba3dd5255c88fe69 Mon Sep 17 00:00:00 2001 From: Ahmad Vazirna Date: Wed, 10 Jun 2026 19:06:39 +0200 Subject: [PATCH 4/4] Wait for overflow menu item to be rendered --- .../src/org/commcare/utils/InstrumentationUtility.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/instrumentation-tests/src/org/commcare/utils/InstrumentationUtility.kt b/app/instrumentation-tests/src/org/commcare/utils/InstrumentationUtility.kt index 3a3195dbb9..d53cdf48d9 100644 --- a/app/instrumentation-tests/src/org/commcare/utils/InstrumentationUtility.kt +++ b/app/instrumentation-tests/src/org/commcare/utils/InstrumentationUtility.kt @@ -169,6 +169,7 @@ object InstrumentationUtility { // Click on About CommCare 4 times to become developer. for (i in 0..3) { openOptionsMenu() + onView(isRoot()).perform(waitForView(withText("About CommCare"))) onView(withText("About CommCare")) .perform(click()) onView(withText(R.string.ok))