# ComposeUiTestConfig

Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/ComposeUiTestConfig.+class:androidx.compose.ui.test.ComposeUiTestConfig) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01) Common/AllAndroid/JVM
- Cmn

  ```
  class ComposeUiTestConfig
  ```

*** ** * ** ***

Defines the configuration requirements for a Compose test environment.

This configuration allows for fine-grained control over the test execution environment, including the coroutine contexts used for composition and test execution, the overall test timeout, and the initial input mode.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#ComposeUiTestConfig(kotlin.coroutines.CoroutineContext,kotlin.coroutines.CoroutineContext,kotlin.time.Duration,androidx.compose.ui.input.InputMode,androidx.compose.ui.test.TestFailurePolicy,androidx.compose.ui.unit.Dp)( effectContext: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html, runTestContext: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html, testTimeout: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-duration/index.html, inputMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/InputMode, failurePolicy: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TestFailurePolicy, boundsAssertionTolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` | Cmn android |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#hashCode()()` | android |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#boundsAssertionTolerance()` The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` tolerance used for bounds assertions (such as `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).assertWidthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).assertHeightIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`, and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).assertPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`). | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#effectContext()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` used to run the composition. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TestFailurePolicy` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#failurePolicy()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TestFailurePolicy` used to configure the failure handling pipeline, such as capture modes for diagnostic artifacts (screenshots, UI hierarchy) and custom failure handlers. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/InputMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#inputMode()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/InputMode` to be used for the test. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#runTestContext()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` used to create the context to run the test block. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-duration/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#testTimeout()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-duration/index.html` within which the test is expected to complete, otherwise a platform specific timeout exception will be thrown. | Cmn android |

## Public constructors

### ComposeUiTestConfig

Cmn android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
ComposeUiTestConfig(
    effectContext: CoroutineContext = EmptyCoroutineContext,
    runTestContext: CoroutineContext = EmptyCoroutineContext,
    testTimeout: Duration = 60.seconds,
    inputMode: InputMode = InputMode.Touch,
    failurePolicy: TestFailurePolicy = TestFailurePolicy(),
    boundsAssertionTolerance: Dp = Dp.Unspecified
)
```

## Public functions

### equals

android

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

android

```
open fun hashCode(): Int
```

## Public properties

### boundsAssertionTolerance

Cmn android

```
val boundsAssertionTolerance: Dp
```

The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` tolerance used for bounds assertions (such as `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).assertWidthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).assertHeightIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`, and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).assertPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`). Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Unspecified()`.

### effectContext

Cmn android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val effectContext: CoroutineContext
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` used to run the composition. The context for `LaunchedEffect`s and `rememberCoroutineScope` will be derived from this context. If this context contains a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-dispatcher/index.html` or `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scheduler/index.html` (in that order), it will be used for composition and the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/MainTestClock`. Defaults to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-empty-coroutine-context/index.html`.

### failurePolicy

Cmn android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val failurePolicy: TestFailurePolicy
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TestFailurePolicy` used to configure the failure handling pipeline, such as capture modes for diagnostic artifacts (screenshots, UI hierarchy) and custom failure handlers. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TestFailurePolicy`.

### inputMode

Cmn android

```
val inputMode: InputMode
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/InputMode` to be used for the test. This determines how input events (such as touch or keyboard) are injected and handled during the test execution. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/InputMode#Touch()`.

### runTestContext

Cmn android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val runTestContext: CoroutineContext
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` used to create the context to run the test block. By default, test block will run using `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/index.html`. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#(kotlin.coroutines.CoroutineContext,kotlin.coroutines.CoroutineContext,kotlin.time.Duration,androidx.compose.ui.input.InputMode,androidx.compose.ui.test.TestFailurePolicy,androidx.compose.ui.unit.Dp)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/ComposeUiTestConfig#(kotlin.coroutines.CoroutineContext,kotlin.coroutines.CoroutineContext,kotlin.time.Duration,androidx.compose.ui.input.InputMode,androidx.compose.ui.test.TestFailurePolicy,androidx.compose.ui.unit.Dp)` must not share `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scheduler/index.html`. Defaults to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-empty-coroutine-context/index.html`.

### testTimeout

Cmn android

```
val testTimeout: Duration
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-duration/index.html` within which the test is expected to complete, otherwise a platform specific timeout exception will be thrown. Defaults to 60 seconds.