What problem does it solve? Testing a single Android Fragment without launching a full host Activity is error-prone: the default FragmentScenario theme is not AppCompat, the manifest artifact must sit on the right Gradle configuration, and findNavController() crashes because EmptyFragmentActivity has no NavHostFragment. This Skill encodes the correct setup and the known traps so instrumentation tests run on the first attempt. ## Core Features & Use Cases - Correct dependency setup: Places androidx.fragment:fragment-testing on androidTestImplementation and fragment-testing-manifest on debugImplementation so EmptyFragmentActivity is merged into the test APK manifest. - Launcher selection and configuration: Chooses between launchFragmentInContainer (attached to android.R.id.content) and launchFragment (headless), passes fragmentArgs, overrides themeResId for AppCompat/Material fragments, and injects a FragmentFactory for non-default constructors. - Lifecycle and navigation handling: Drives states with moveToState and recreate, captures state via withFragment, and works around the findNavController limitation with TestNavHostController. - Use Case: A test crashes with "You need to use a Theme.AppCompat theme (or descendant)" when launching a login fragment; the fix is passing themeResId = R.style.Theme_MyApp to launchFragmentInContainer. ## Quick Start Ask the AI to write an isolated instrumentation test for your Fragment using FragmentScenario with the correct dependencies, theme override, and lifecycle assertions.