Skip to content

Instantly share code, notes, and snippets.

@tugceaktepe
Created June 15, 2023 21:50
Show Gist options
  • Save tugceaktepe/7788822649e56addcf4c831c917fe43f to your computer and use it in GitHub Desktop.
Save tugceaktepe/7788822649e56addcf4c831c917fe43f to your computer and use it in GitHub Desktop.
Test for receiving error from api
@Test
fun showErrorWhenMovieLoadFailed() {
mockWebServer.dispatcher = MockServerDispatcher().ErrorDispatcher()
val scenario = launchActivity<MainActivity>()
onView(withText(Constants.ERROR_MESSAGE)).check(matches(isDisplayed()))
scenario.close()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment