Skip to content

Commit

Permalink
test: [ANDROAPP-5803] check schedule date
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmateos authored and xavimolloy committed Dec 26, 2023
1 parent 09fea16 commit b6ba88e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class TeiDashboardTest : BaseTest() {
clickOnScheduleNew()
clickOnFirstReferralEvent()
clickOnReferralNextButton()
checkEventWasCreated(LAB_MONITORING)
checkEventWasCreatedWithDate(LAB_MONITORING, LAB_MONITORING_SCHEDULE_DATE)
}
}

Expand Down Expand Up @@ -375,6 +375,7 @@ class TeiDashboardTest : BaseTest() {
const val USER = "android"

const val LAB_MONITORING = "Lab monitoring"
const val LAB_MONITORING_SCHEDULE_DATE = "10/9/2019"

const val API_TEI_1_RESPONSE_OK = "mocks/teilist/teilist_1.json"
const val API_TEI_2_RESPONSE_OK = "mocks/teilist/teilist_2.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,37 @@ class TeiDashboardRobot : BaseRobot() {
)
}

fun checkEventWasCreatedWithDate(eventName: String, eventDate: String) {
onView(withId(R.id.tei_recycler))
.check(
matches(
allOf(
isDisplayed(),
isNotEmpty(),
atPosition(
1,
hasDescendant(
allOf(
hasSibling(
allOf(
withId(R.id.programStageName),
withText(eventName),
),
),
hasSibling(
allOf(
withId(R.id.event_date),
withText(eventDate),
),
),
),
),
),
),
),
)
}

fun clickOnMenuDeactivate() {
onView(withText(R.string.deactivate)).perform(click())
}
Expand Down

0 comments on commit b6ba88e

Please sign in to comment.