FailureContext


A contextual object provided to TestFailureHandlers when a Compose UI test fails.

This context encapsulates the environment of the failure, providing both the root exception that triggered the failure and any diagnostic artifacts (such as screenshots or UI hierarchy dumps) that were captured by the testing framework prior to invoking the custom handlers.

Summary

Public constructors

Cmn

Public properties

List<FailureArtifact>

A list of diagnostic FailureArtifact objects generated by the failure pipeline.

Cmn
Throwable

The original Throwable (e.g., AssertionError or timeout exception) that caused the test to fail.

Cmn

Public constructors

FailureContext

FailureContext(
    error: Throwable,
    artifacts: List<FailureArtifact> = emptyList()
)

Public properties

artifacts

val artifactsList<FailureArtifact>

A list of diagnostic FailureArtifact objects generated by the failure pipeline. Handlers can use this list to locate and process the generated diagnostic files on the host platform.

error

val errorThrowable

The original Throwable (e.g., AssertionError or timeout exception) that caused the test to fail.