Screenshot metadata
Attach metadata to screenshots with a companion JSON file to add context on the Argos build page.
Enrich your screenshots in Argos with metadata by adding a companion JSON file. This metadata appears on the build page and helps contextualize how and why a screenshot was generated.
How it works
For each screenshot file, create a metadata file with the same name and the .argos.json suffix:
myscreenshot.png
myscreenshot.png.argos.jsonThe .argos.json file must be valid JSON following the Argos metadata schema.
Schema autocomplete
To enable autocompletion, type checking, and schema validation in editors like VS Code, add a $schema field at the top of your .argos.json file:
{
"$schema": "https://api.argos-ci.com/v2/screenshot-metadata.json"
}Top-level fields
$schema
string?
Ignored. Can be set to get completions, validations, and documentation in some editors.
url
string?
The URL of the page that was screenshotted.
previewUrl
string?
A URL to an accessible preview of the screenshot.
colorScheme
"light" | "dark"
The color scheme when the screenshot was taken.
mediaType
"screen" | "print"
The media type when the screenshot was taken.
tags
string[]?
Custom tags to categorize the screenshot.
Viewport
width(number): Width of the viewport.height(number): Height of the viewport.
Test
id(string?): The unique identifier of the test.title(string): The title of the test.titlePath(string[]): The hierarchy of titles leading to the test.retries(number?): Number of retries for the test.retry(number?): The current retry count.repeat(number?): The repeat count for the test.location(Location?): Where the test is located in the source code.tags(string[]?): Tags associated with the test (e.g. Playwright's test tags).annotations(Test annotation[]?): Extra information about the test.
Location
file(string): The source file.line(number): The line number.column(number): The column number.
Test annotation
type(string): Type of annotation.description(string?): Optional explanation.location(Location?): Where the annotation is located in the source code.
Browser
name(string): Browser name.version(string): Browser version.
Automation library
name(string): The name of the automation library (e.g.playwright,cypress).version(string): The version of the automation library.
SDK
name(string): The name of the Argos SDK.version(string): The version of the Argos SDK.
Story
Storybook story metadata, set by the Argos Storybook SDK.
id(string): Unique ID of the story.tags(string[]?): Tags attached to the story.mode(string?): The story mode used for the capture.play(boolean?): True if the story has a play function.
Capture
Where the screenshot falls within its test, following capture order. Argos uses it to review the screenshots of a test in the order the test took them, see Follow a journey step by step.
index(number): The 0-based position of the screenshot within its test, following capture order. Variants of one screen taken by a single call, several viewports for example, share an index, and a retry starts over at0.
Recorded by @argos-ci/playwright 7.5.1, @argos-ci/cypress 7.2.1 and @argos-ci/vitest 0.6.1 and above.
Transient
Upload-time instructions consumed by the Argos CLI and SDKs. Unlike the other fields, transient is not stored with the screenshot — the uploader reads it, applies it, and removes it from the metadata.
threshold(number?): Sensitivity threshold for this screenshot's comparison, between0and1.baseName(string | string[]?): Name(s) used to find the comparison baseline, instead of the screenshot's own name. An array is tried in order and the first name found in the baseline wins, which lets a new screenshot fall back to an existing one. More on fallback baselines.parentName(string?): Name of the parent snapshot — used to attach a file to another snapshot, for example an ARIA snapshot to its screenshot.
Complete example
Here's a full example of myscreenshot.png.argos.json:
Notes
Fields marked as required must be included.
Unknown fields are ignored.
Each screenshot can have its own metadata file.
Last updated
Was this helpful?