AndroidComposeUiTestEnvironment
@ExperimentalTestApi
inline fun <A : ComponentActivity> AndroidComposeUiTestEnvironment(
    effectContext: CoroutineContext = EmptyCoroutineContext,
    runTestContext: CoroutineContext = EmptyCoroutineContext,
    testTimeout: Duration = 60.seconds,
    crossinline activityProvider: () -> A?,
): AndroidComposeUiTestEnvironment<A>
Creates an AndroidComposeUiTestEnvironment that retrieves the
host Activity by delegating to the given activityProvider. Use
this if you need to launch an Activity in a way that is not compatible with any of the existing
runComposeUiTest, runAndroidComposeUiTest, or runEmptyComposeUiTest methods.
Valid use cases include, but are not limited to, creating your own JUnit test rule that
implements AndroidComposeUiTest by delegating to AndroidComposeUiTestEnvironment.test. See
AndroidComposeTestRule for a reference
implementation.
The activityProvider is called every time activity is called,
which in turn is called when setContent is called.
The most common implementation of an activityProvider retrieves the activity from a backing
ActivityScenario (that the caller launches within the lambda passed to runTest), but one is
not limited to this pattern.
Parameters
| activityProvider | A lambda that should return the current Activity instance of type A, if it is available. If it is not available, it should returnnull. | 
| A | The Activity type to be interacted with, which typically (but not necessarily) is the activity that was launched and hosts the Compose content. | 
| effectContext | The CoroutineContextused to run the composition. The context forLaunchedEffects andrememberCoroutineScopewill be derived from this context. If this context contains aTestDispatcherorTestCoroutineScheduler(in that order), it will be used for composition and theMainTestClock. | 
| runTestContext | The CoroutineContextused to create the context to run the test. By default it will run usingkotlinx.coroutines.test.StandardTestDispatcher.runTestContextandeffectContextmust not shareTestCoroutineScheduler. | 
| testTimeout | The Durationwithin which the test is expected to complete, otherwise a platform specific timeout exception will be thrown. | 
