Last active
January 26, 2021 11:57
-
-
Save canergulgec/5d57c38e35eb537f832b60b4f463e476 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@LargeTest | |
class MovieFragmentTest { | |
private lateinit var activityScenario: ActivityScenario<MainActivity> | |
private val mockWebServer = MockWebServer() | |
@Before | |
fun setup() { | |
mockWebServer.start(port) | |
IdlingRegistry.getInstance().register( | |
OkHttp3IdlingResource.create( | |
"okhttp", | |
OkHttpProvider.getOkHttpClient() | |
) | |
) | |
activityScenario = ActivityScenario.launch(MainActivity::class.java) | |
} | |
@Test | |
fun recyclerview_second_item_should_be_visible() { | |
mockWebServer.dispatcher = dispatcherWithCustomBody() | |
onScreen<MovieScreen> { | |
recycler { | |
childAt<MovieScreen.Item>(2) { | |
name { isVisible() } | |
} | |
} | |
} | |
} | |
@After | |
fun cleanup() { | |
mockWebServer.close() | |
activityScenario.close() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment