Skip to content

Commit

Permalink
[ANDROAPP-6175] Check if grouped events option is visible
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo <[email protected]>
  • Loading branch information
Balcan committed May 22, 2024
1 parent 95b9d32 commit 16b0fb6
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem
import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition
Expand Down Expand Up @@ -395,7 +397,15 @@ class TeiDashboardRobot(val composeTestRule: ComposeTestRule) : BaseRobot() {
}

fun clickOnTimelineEvents() {
onView(withText(R.string.show_events_timeline)).perform(click())
try {
onView(withText(R.string.show_events_timeline)).perform(click())
}catch (e: NoMatchingViewException){
checkIfGroupedEventsIsVisible()
}
}

private fun checkIfGroupedEventsIsVisible(){
onView(withText(R.string.group_events_by_stage)).check(matches(isDisplayed()))
}

fun checkEventWasScheduled(eventName: String, position: Int) {
Expand Down

0 comments on commit 16b0fb6

Please sign in to comment.