From a0cbcee3521873f2a3efa89948e1142c0e40fbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Miguel=20Rubio?= Date: Wed, 17 Jul 2024 15:42:17 +0200 Subject: [PATCH] test: fix shouldSuccessfullySearchUsingMoreThanOneField (#3732) Signed-off-by: andresmr --- .../java/org/dhis2/usescases/searchte/robot/SearchTeiRobot.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/SearchTeiRobot.kt b/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/SearchTeiRobot.kt index 230a03aa87..2c2e3c70cb 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/SearchTeiRobot.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/SearchTeiRobot.kt @@ -1,5 +1,6 @@ package org.dhis2.usescases.searchte.robot +import androidx.compose.ui.test.ExperimentalTestApi import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.hasParent import androidx.compose.ui.test.hasTestTag @@ -108,9 +109,10 @@ class SearchTeiRobot(val composeTestRule: ComposeTestRule) : BaseRobot() { composeTestRule.waitForIdle() } + @OptIn(ExperimentalTestApi::class) fun checkListOfSearchTEI(title: String, attributes: Map) { //Checks title and all attributes are displayed - composeTestRule.waitForIdle() + composeTestRule.waitUntilAtLeastOneExists(hasText(title)) composeTestRule.onNodeWithText(title).assertIsDisplayed() attributes.forEach { item -> item.key?.let { composeTestRule.onNodeWithText("$it:",true).assertIsDisplayed() }