From 3ea368ab741aeb7ea7b1b3718135d64792ad103a Mon Sep 17 00:00:00 2001 From: andresmr Date: Wed, 17 Jul 2024 12:27:20 +0200 Subject: [PATCH] test: [ANDROAPP-6326] wait until sync successful Signed-off-by: andresmr --- .../org/dhis2/usescases/flow/syncFlow/robot/SyncFlowRobot.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/androidTest/java/org/dhis2/usescases/flow/syncFlow/robot/SyncFlowRobot.kt b/app/src/androidTest/java/org/dhis2/usescases/flow/syncFlow/robot/SyncFlowRobot.kt index ff52409966..47febdf6ea 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/flow/syncFlow/robot/SyncFlowRobot.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/flow/syncFlow/robot/SyncFlowRobot.kt @@ -30,9 +30,11 @@ class SyncFlowRobot(val composeTestRule: ComposeTestRule) : BaseRobot() { composeTestRule.onNodeWithTag(MAIN_BUTTON_TAG, useUnmergedTree = true).performClick() } + @OptIn(ExperimentalTestApi::class) fun checkSyncWasSuccessfully() { val expectedTitle = InstrumentationRegistry.getInstrumentation() .targetContext.getString(R.string.sync_dialog_title_synced) + composeTestRule.waitUntilAtLeastOneExists(hasText(expectedTitle)) composeTestRule.onNodeWithTag(TITLE, useUnmergedTree = true).assert(hasText(expectedTitle, true)) }