diff --git a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/dialogs/scheduling/SchedulingDialogUiTest.kt b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/dialogs/scheduling/SchedulingDialogUiTest.kt index 4aa70eb56a..a276bdac1e 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/dialogs/scheduling/SchedulingDialogUiTest.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/dialogs/scheduling/SchedulingDialogUiTest.kt @@ -1,6 +1,10 @@ package org.dhis2.usescases.teidashboard.dialogs.scheduling +import androidx.compose.ui.test.ExperimentalTestApi +import androidx.compose.ui.test.hasTestTag import androidx.compose.ui.test.junit4.createAndroidComposeRule +import androidx.compose.ui.test.onAllNodesWithTag +import androidx.compose.ui.test.onFirst import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick @@ -110,6 +114,7 @@ class SchedulingDialogUiTest { composeTestRule.onNodeWithText("Done").assertExists() } + @OptIn(ExperimentalTestApi::class) @Test fun selectProgramStage() { val programStages = listOf( @@ -126,7 +131,8 @@ class SchedulingDialogUiTest { } } - composeTestRule.onNodeWithText("Program stage").performClick() + composeTestRule.onAllNodesWithTag("INPUT_DROPDOWN").onFirst().performClick() + composeTestRule.waitUntilExactlyOneExists(hasTestTag("INPUT_DROPDOWN_MENU_ITEM_1")) composeTestRule.onNodeWithTag("INPUT_DROPDOWN_MENU_ITEM_1").performClick() verify(viewModel).updateStage(programStages[1]) diff --git a/compose-table/src/androidTest/java/org/dhis2/composetable/CellTableTest.kt b/compose-table/src/androidTest/java/org/dhis2/composetable/CellTableTest.kt index ecd24f51e2..aed210b4cc 100644 --- a/compose-table/src/androidTest/java/org/dhis2/composetable/CellTableTest.kt +++ b/compose-table/src/androidTest/java/org/dhis2/composetable/CellTableTest.kt @@ -105,14 +105,13 @@ class CellTableTest { composeTestRule.waitForIdle() clickOnAccept() composeTestRule.waitForIdle() - Espresso.pressBack() assertCellSelected(firstId, 1, 0) clickOnCell(firstId, 1, 0) assertInputComponentInfo( expectedMainLabel = "Text 2", expectedSecondaryLabels = fakeModel.find { it.id == firstId }?.tableHeaderModel?.rows - ?.joinToString(separator = ",") { it.cells[0 % it.cells.size].value } ?: "" + ?.joinToString(separator = ",") { it.cells[0].value } ?: "" ) } }