diff --git a/app/src/androidTest/java/org/dhis2/common/filters/FiltersRobot.kt b/app/src/androidTest/java/org/dhis2/common/filters/FiltersRobot.kt index de1e6693b7..15f89715a2 100644 --- a/app/src/androidTest/java/org/dhis2/common/filters/FiltersRobot.kt +++ b/app/src/androidTest/java/org/dhis2/common/filters/FiltersRobot.kt @@ -1,24 +1,16 @@ package org.dhis2.common.filters -import androidx.compose.ui.test.junit4.ComposeTestRule -import androidx.compose.ui.test.onNodeWithTag -import androidx.compose.ui.test.performClick -import androidx.compose.ui.test.performScrollTo import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.TypeTextAction import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.contrib.PickerActions import androidx.test.espresso.contrib.RecyclerViewActions -import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.withId import org.dhis2.R import org.dhis2.common.BaseRobot import org.dhis2.common.matchers.DatePickerMatchers.Companion.matchesDate import org.dhis2.commons.filters.FilterHolder -import org.dhis2.ui.dialogs.orgunit.DONE_TEST_TAG -import org.dhis2.ui.dialogs.orgunit.ITEM_CHECK_TEST_TAG -import org.dhis2.ui.dialogs.orgunit.ITEM_TEST_TAG fun filterRobotCommon(robotBody: FiltersRobot.() -> Unit) { FiltersRobot().apply { @@ -56,7 +48,7 @@ class FiltersRobot : BaseRobot() { } fun selectNotSyncedState() { - onView( withId(R.id.stateNotSynced)).perform(click()) + onView(withId(R.id.stateNotSynced)).perform(click()) } fun acceptDateSelected() { @@ -66,6 +58,4 @@ class FiltersRobot : BaseRobot() { fun checkDate(year: Int, monthOfYear: Int, dayOfMonth: Int) { onView(withId(R.id.datePicker)).check(matches(matchesDate(year, monthOfYear, dayOfMonth))) } - - } \ No newline at end of file diff --git a/app/src/androidTest/java/org/dhis2/usescases/orgunitselector/OrgUnitSelectorRobot.kt b/app/src/androidTest/java/org/dhis2/usescases/orgunitselector/OrgUnitSelectorRobot.kt index 0bf70d5177..5fb7fc6452 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/orgunitselector/OrgUnitSelectorRobot.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/orgunitselector/OrgUnitSelectorRobot.kt @@ -2,11 +2,10 @@ package org.dhis2.usescases.orgunitselector 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.performScrollTo import org.dhis2.common.BaseRobot -import org.dhis2.ui.dialogs.orgunit.DONE_TEST_TAG -import org.dhis2.ui.dialogs.orgunit.ITEM_CHECK_TEST_TAG fun orgUnitSelectorRobot( composeTestRule: ComposeTestRule, @@ -19,9 +18,9 @@ fun orgUnitSelectorRobot( class OrgUnitSelectorRobot(private val composeTestRule: ComposeTestRule) : BaseRobot() { fun selectTreeOrgUnit(orgUnitName: String) { - composeTestRule.onNodeWithTag("$ITEM_CHECK_TEST_TAG$orgUnitName") + composeTestRule.onNodeWithTag("ORG_TREE_ITEM_$orgUnitName") .performScrollTo() .performClick() - composeTestRule.onNodeWithTag(DONE_TEST_TAG).performClick() + composeTestRule.onNodeWithText("Done").performClick() } } \ No newline at end of file