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
public class Type private constructor(private val value: Int)
Defines the category of a FailureArtifact.
Functions
toString
override fun toString(): String
Members
Companion
public companion object
Properties
Screenshot
public val Screenshot: Type = Type(0)
UiHierarchy
public val UiHierarchy: Type = Type(1)