You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing a Fragment with JUnit 5 works exactly like it does with JUnit 4: through the FragmentScenario API. Unlike Activity tests, there is no special extension for Fragment-based tests: If you want to launch a scenario for a Fragment, simply use the API directly:
classMyFragmentTest {
@Test
funmyTest() {
val scenario =FragmentScenario.launch<MyFragment>()
// Do something with the scenario here...
}
}