From 50564fafed7b503a6122e12ca83983ac29078e97 Mon Sep 17 00:00:00 2001 From: Xavier Molloy Date: Thu, 11 Jul 2024 12:49:06 +0200 Subject: [PATCH] fix: [ANDROAPP-6315] fix failing tests --- .../dhis2/usescases/programevent/robot/ProgramEventsRobot.kt | 2 +- .../java/org/dhis2/usescases/searchte/robot/SearchTeiRobot.kt | 2 +- .../java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/java/org/dhis2/usescases/programevent/robot/ProgramEventsRobot.kt b/app/src/androidTest/java/org/dhis2/usescases/programevent/robot/ProgramEventsRobot.kt index 8987cb9ad1..8f2e689ca3 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/programevent/robot/ProgramEventsRobot.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/programevent/robot/ProgramEventsRobot.kt @@ -62,7 +62,7 @@ class ProgramEventsRobot(val composeTestRule: ComposeContentTestRule) : BaseRobo @OptIn(ExperimentalTestApi::class) fun checkEventIsComplete(eventDate: String) { - composeTestRule.waitUntilAtLeastOneExists(hasText("Event completed")) + composeTestRule.waitUntilAtLeastOneExists(hasText("Event completed"), 2500) composeTestRule.onNodeWithText(eventDate).assertIsDisplayed() composeTestRule.onNodeWithText("Event completed").assertIsDisplayed() } 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 d7a5b56735..ad9313ee80 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 @@ -152,7 +152,7 @@ class SearchTeiRobot(val composeTestRule: ComposeTestRule) : BaseRobot() { val title = "First name: ${displayListFieldsUIModel.name}" val displayedAttributes = createAttributesList(displayListFieldsUIModel) //When we expand all attribute list - composeTestRule.onNodeWithText("Show more").performClick() + composeTestRule.onNodeWithText("Show more", true).performClick() composeTestRule.waitForIdle() //Then The title and all attributes are displayed composeTestRule.onNodeWithText(title).assertIsDisplayed() diff --git a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt index 6f8be0226a..204da74ec6 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt @@ -271,6 +271,7 @@ class TeiDashboardTest : BaseTest() { } enrollmentRobot(composeTestRule) { + composeTestRule.waitForIdle() clickOnAProgramForEnrollment(composeTestRule, womanProgram) clickOnAcceptInDatePicker() openFormSection(personAttribute)