Artifact

interface Artifact(source)

Something the device produced that a test may keep: a Screenshot, a Hierarchy, a DeviceInfo or a DriverLog. Every artifact is plain data with its serialized bytes and mediaType, so it can go to a file (save), a report, an HTTP upload or an assertion without touching the device again.

Inheritors

Properties

Link copied to clipboard
abstract val bytes: ByteArray

The serialized form: PNG, UTF-8 XML, UTF-8 JSON or UTF-8 text.

Link copied to clipboard
abstract val extension: String

The usual file extension for bytes, without the dot, e.g. png.

Link copied to clipboard
abstract val mediaType: String

The IANA media type of bytes, e.g. image/png.

Functions

Link copied to clipboard
open fun save(path: Path): Path

Writes bytes to path (parent directories are created) and returns path.