Package-level declarations

Types

Link copied to clipboard

FragmentScenario provides API to start and drive a Fragment's lifecycle state for testing. It works with arbitrary fragments and works consistently across different versions of the Android framework.

Functions

Link copied to clipboard
inline fun <F : Fragment> launchHiltFragment(fragmentArgs: Bundle? = null, @StyleRes themeResId: Int = EmptyHiltActivity.DEFAULT_THEME, initialState: Lifecycle.State = Lifecycle.State.RESUMED): HiltFragmentScenario<F>
inline fun <F : Fragment, A : EmptyHiltActivity> launchHiltFragment(fragmentArgs: Bundle? = null, activityClass: Class<A>, @StyleRes themeResId: Int = EmptyHiltActivity.DEFAULT_THEME, initialState: Lifecycle.State = Lifecycle.State.RESUMED): HiltFragmentScenario<F>

Launches a Fragment in the Activity's root view container android.R.id.content, with given arguments hosted by an empty FragmentActivity and waits for it to reach initialState.

Link copied to clipboard
inline fun <F : Fragment, T : Any> HiltFragmentScenario<F>.withFragment(crossinline block: F.() -> T): T

Run block using HiltFragmentScenario.onFragment, returning the result of the block.