Skip to content

Commit

Permalink
refactor: [ANDROAPP-6170] Change typeOnInputDateField to replace text
Browse files Browse the repository at this point in the history
Signed-off-by: andresmr <[email protected]>
  • Loading branch information
andresmr committed May 31, 2024
1 parent 376bb8e commit 069d5c9
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 069d5c9

Please sign in to comment.