Start native apps faster with the Composables CLI ->
Class

FailureArtifact

Represents a diagnostic artifact produced by the test failure pipeline when a Compose UI test fails.

Source set: Common
public class FailureArtifact(public val type: Type, public val fileName: String)

Represents a diagnostic artifact produced by the test failure pipeline when a Compose UI test fails.

Artifacts capture the state of the UI at the moment of failure, such as visual screenshots or structural UI hierarchy dumps. Custom handlers implementing TestFailureHandler receive a list of these artifacts within the FailureContext.

The fileName serves as an identifier to access the underlying file. The exact location and lifecycle of this file depend on the specific platform's test storage mechanisms.

Android Platform: On Android, the framework writes these artifacts to the PlatformTestStorage provided by AndroidX Test. You can use the fileName to retrieve the file's URI or read its bytes directly via the registry:

Members

Type

Source set: Common
public class Type private constructor(private val value: Int)

Defines the category of a FailureArtifact.

Functions

toString

Source set: Common
override fun toString(): String

Members

Companion

Source set: Common
public companion object

Properties

Screenshot

Source set: Common
public val Screenshot: Type = Type(0)

UiHierarchy

Source set: Common
public val UiHierarchy: Type = Type(1)