Skip to content

Commit d15f126

Browse files
authored
Document how to compare text with Argos (#206)
1 parent cc7ecd5 commit d15f126

3 files changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
slug: /compare-non-image-files
3+
sidebar_label: Non-image comparisons
4+
description: Compare text-based artifacts in Argos by uploading them with the CLI.
5+
---
6+
7+
import { RunPkgCommand } from "@site/src/partials";
8+
9+
# Compare non-image files
10+
11+
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.
12+
13+
![Compare non-image files in Argos](json-comparison.png)
14+
15+
## Upload non-image files
16+
17+
Use the `-f` or `--files` option to tell the CLI which files to upload:
18+
19+
<RunPkgCommand
20+
command={
21+
'argos upload -f "**/*.{txt,json,yaml,yml,xml,html,md,css,js}" ./snapshots'
22+
}
23+
/>
24+
25+
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:
26+
27+
<RunPkgCommand
28+
command={[
29+
'argos upload -f "**/*.{png,jpg,jpeg}" "**/*.{txt,json,yaml,yml,xml,html,md,css,js}" ./snapshots',
30+
]}
31+
/>
32+
33+
Use stable file names and paths so Argos can match each uploaded file with its baseline on future builds.
34+
35+
## Supported content types
36+
37+
Argos currently supports these non-image content types:
38+
39+
- `text/plain`
40+
- `application/json`
41+
- `application/yaml`
42+
- `text/yaml`
43+
- `application/xml`
44+
- `text/xml`
45+
- `text/html`
46+
- `text/markdown`
47+
- `text/css`
48+
- `application/javascript`
49+
- `text/javascript`
50+
51+
## Framework support
52+
53+
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.
406 KB
Loading

docs/sdks/cli.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Use the `upload` command to upload screenshots stored in your `./screenshots` di
4747

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

50+
### Compare non-image files
51+
52+
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.
53+
5054
### Debug mode
5155

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

0 commit comments

Comments
 (0)