Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/learn/guides/visual-coverage/compare-non-image-files.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
slug: /compare-non-image-files
sidebar_label: Non-image comparisons
description: Compare text-based artifacts in Argos by uploading them with the CLI.
---

import { RunPkgCommand } from "@site/src/partials";

# Compare non-image files

Argos can compare more than screenshots. With the CLI, you can upload text-based artifacts such as API snapshots, generated HTML, Markdown files, CSS output, JavaScript bundles, XML documents, YAML files, or JSON fixtures and review their changes in Argos.

![Compare non-image files in Argos](json-comparison.png)

## Upload non-image files

Use the `-f` or `--files` option to tell the CLI which files to upload:

<RunPkgCommand
command={
'argos upload -f "**/*.{txt,json,yaml,yml,xml,html,md,css,js}" ./snapshots'
}
/>

The `-f` option replaces the default screenshot glob. If you want to upload screenshots and non-image files in the same build, include both patterns:

<RunPkgCommand
command={[
'argos upload -f "**/*.{png,jpg,jpeg}" "**/*.{txt,json,yaml,yml,xml,html,md,css,js}" ./snapshots',
]}
/>

Use stable file names and paths so Argos can match each uploaded file with its baseline on future builds.

## Supported content types

Argos currently supports these non-image content types:

- `text/plain`
- `application/json`
- `application/yaml`
- `text/yaml`
- `application/xml`
- `text/xml`
- `text/html`
- `text/markdown`
- `text/css`
- `application/javascript`
- `text/javascript`

## Framework support

Non-image comparisons are only supported through the CLI for now. [Contact us](mailto:contact@argos-ci.com) if you are interested in using this feature from a test framework like Vitest.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/sdks/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ Use the `upload` command to upload screenshots stored in your `./screenshots` di

<RunPkgCommand command="argos upload ./screenshots" />

### Compare non-image files

Use `-f` or `--files` to upload text-based artifacts such as JSON, YAML, XML, HTML, Markdown, CSS, or JavaScript files. See [Compare non-image files](/compare-non-image-files) for examples and the full list of supported content types.

### Debug mode

You can enable debug mode by setting the `DEBUG` environment variable.
Expand Down