- config.yml updated

This commit is contained in:
2023-09-15 16:49:00 +01:00
parent 3d4639403f
commit 06b51d3081
2 changed files with 6 additions and 19 deletions

View File

@@ -23,6 +23,7 @@ import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.RootMatchers.isDialog import androidx.test.espresso.matcher.RootMatchers.isDialog
import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry
import com.appttude.h_mal.farmr.R
import com.appttude.h_mal.farmr.ui.utils.EspressoHelper.waitForView import com.appttude.h_mal.farmr.ui.utils.EspressoHelper.waitForView
import org.hamcrest.CoreMatchers.allOf import org.hamcrest.CoreMatchers.allOf
import org.hamcrest.CoreMatchers.anything import org.hamcrest.CoreMatchers.anything
@@ -58,6 +59,8 @@ open class BaseTestRobot {
fun matchText(resId: Int, text: String): ViewInteraction = matchText(matchView(resId), text) fun matchText(resId: Int, text: String): ViewInteraction = matchText(matchView(resId), text)
fun scrollTo(viewId: Int): ViewInteraction = matchView(viewId).perform(ViewActions.scrollTo())
fun clickListItem(listRes: Int, position: Int) { fun clickListItem(listRes: Int, position: Int) {
onData(anything()) onData(anything())
.inAdapterView(allOf(withId(listRes))) .inAdapterView(allOf(withId(listRes)))

View File

@@ -1,5 +1,7 @@
package com.appttude.h_mal.farmr.ui.tests package com.appttude.h_mal.farmr.ui.tests
import androidx.test.espresso.action.ViewActions
import com.appttude.h_mal.farmr.R
import com.appttude.h_mal.farmr.model.Order import com.appttude.h_mal.farmr.model.Order
import com.appttude.h_mal.farmr.model.ShiftType import com.appttude.h_mal.farmr.model.ShiftType
import com.appttude.h_mal.farmr.model.Sortable import com.appttude.h_mal.farmr.model.Sortable
@@ -125,23 +127,6 @@ class ShiftTests : BaseTest<MainActivity>(MainActivity::class.java) {
} }
listScreen { listScreen {
assertListCount(4) assertListCount(4)
homeScreen {
waitFor(600)
clickClearFilterInMenu()
waitFor(600)
assertListCount(8)
clickFilterInMenu()
}
}
filterScreen {
val calendar = Calendar.getInstance()
val year = calendar.get(YEAR)
val month = calendar.get(MONTH) + 1
setDateOut(year, month, 6)
submit()
}
listScreen {
assertListCount(5)
} }
} }
@@ -178,9 +163,8 @@ class ShiftTests : BaseTest<MainActivity>(MainActivity::class.java) {
clickTab(HomeScreenRobot.Tab.CALENDAR) clickTab(HomeScreenRobot.Tab.CALENDAR)
} }
calendarScreen { calendarScreen {
waitFor(600)
clickOnCalendarDay(1) clickOnCalendarDay(1)
waitFor(600) scrollTo(R.id.shifts_available_recycler)
clickOnListItemAtPosition(0) clickOnListItemAtPosition(0)
} }
viewScreen { viewScreen {