Skip to content

Commit

Permalink
fix test to change datepicker date
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmateos committed Jun 6, 2024
1 parent 9ce4ca8 commit f745aff
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.hasAnySibling
import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.isDialog
import androidx.compose.ui.test.isRoot
import androidx.compose.ui.test.junit4.ComposeTestRule
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.onRoot
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performTextReplacement
import androidx.compose.ui.test.printToLog
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
Expand Down Expand Up @@ -114,7 +118,8 @@ class EventRobot(val composeTestRule: ComposeTestRule) : BaseRobot() {
fun selectSpecificDate(currentDate: String, date: String) {
composeTestRule.onNodeWithTag("DATE_PICKER").assertIsDisplayed()
composeTestRule.onNodeWithContentDescription(
"Switch to text input mode",
label = "text",
substring = true,
useUnmergedTree = true,
).performClick()
composeTestRule.onNodeWithText(currentDate).performTextReplacement(date)
Expand Down

0 comments on commit f745aff

Please sign in to comment.