Dmitry Si
Dmitry Si
Dec 12, 2019 · 1 min read

Yes, this approach works for Fragments testing with or without Navigation Component. FragmentScenario allows launching any fragment regardless of them being used in the navigation graph and offers additional tools for testing the navigation itself.
Note that the fragment-scenario was designed to test fragment in isolation, which means it doesn’t work well with OnFragmentInteractionListener pattern previously recommended by Google. The fragment should make no assumptions about the host activity.

    Dmitry Si

    Written by

    Dmitry Si

    Software developer. Most recently Android Java/Kotlin engineer. Former manager, desktop and embedded software creator. https://github.com/fo2rist/