From 069d5c97b28ac6c41a66d63ec09c2b49796d3433 Mon Sep 17 00:00:00 2001 From: andresmr Date: Fri, 31 May 2024 11:24:20 +0200 Subject: [PATCH] refactor: [ANDROAPP-6170] Change typeOnInputDateField to replace text Signed-off-by: andresmr --- .../usescases/teidashboard/robot/EnrollmentRobot.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/robot/EnrollmentRobot.kt b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/robot/EnrollmentRobot.kt index 362ccb3802..ba8028ec19 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/robot/EnrollmentRobot.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/robot/EnrollmentRobot.kt @@ -7,8 +7,7 @@ import androidx.compose.ui.test.junit4.ComposeTestRule import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick -import androidx.compose.ui.test.performTextClearance -import androidx.compose.ui.test.performTextInput +import androidx.compose.ui.test.performTextReplacement import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches @@ -108,16 +107,14 @@ class EnrollmentRobot(val composeTestRule: ComposeTestRule) : BaseRobot() { fun typeOnInputDateField(dateValue: String, title: String) { composeTestRule.apply { - val node = onNode( + onNode( hasTestTag( "INPUT_DATE_TIME_TEXT_FIELD" ) and hasAnySibling( hasText(title) ), useUnmergedTree = true, - ) - node.performTextClearance() - node.performTextInput(dateValue) + ).performTextReplacement(dateValue) } }