# bdy tests

> For AI agents: the complete documentation index is at https://buddy.works/llms.txt

## Usage

```bash
bdy tests [options] [command]
```

Manage unit tests and visual regression (Storybook, URL captures, test runners)

## Options

| **Option** | **Description** |
| :--- | :--- |
| `--context <name>` | Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation. |
| `--examples` | Show only examples; with this flag --format accepts text, json or jsonl |
| `--verbose` | Show REST API requests, responses, timing and retries on stderr |
| `-h, --help` | display help for command |

## Available Commands

| **Command** | **Description** |
| :--- | :--- |
| [visual](https://buddy.works/docs/cli/tests/visual.md) | Manage visual regression testing across Storybook, URL captures, and test
  runners |
| [capture](https://buddy.works/docs/cli/tests/capture.md) | Create a visual test session from an explicit URL list, a URLs file, or a
  sitemap |
| [unit](https://buddy.works/docs/cli/tests/unit.md) | Manage unit testing (JUnit XML report uploads, suite linking) |

Documentation for bdy v1.25.38

## Examples

### Upload junit xml report

```bash
bdy tests unit upload "reports/**/*.xml" --format junit-xml
```

### Preview which files would be uploaded without sending

```bash
bdy tests unit upload "reports/**/*.xml" --format junit-xml --dryRun
```

### Interactively link current directory to a unit test suite

```bash
bdy tests unit link
```

### Link non-interactively to a specific suite

```bash
bdy tests unit link -w workspace -p project -s suite-identifier
```

### Install the resource-discovery browser (needed by `session create` unless --skipDiscovery)

```bash
bdy tests visual setup
```

### Upload a built Storybook to the linked visual test suite

```bash
bdy tests visual upload ./storybook-static
```

### Interactively link current directory to a visual test suite

```bash
bdy tests visual link
```

### Link non-interactively to a specific suite

```bash
bdy tests visual link -w workspace -p project -s suite-identifier
```

### Run your test command with the visual-test plugin server attached

```bash
bdy tests visual session create "npm test"
```

### Skip resource discovery (debugging or asset-free pages)

```bash
bdy tests visual session create "npm test" --skipDiscovery
```

### Send snapshots progressively (quicker review during long runs)

```bash
bdy tests visual session create "npm test" --oneByOne
```

### One runner in a parallel session (every runner must share the same $SNAPSHOTS_BUILD_ID)

```bash
bdy tests visual session create "npm test" --parallel
```

### Close the session after all parallel runners finished (build id read from $SNAPSHOTS_BUILD_ID)

```bash
bdy tests visual session close
```

### Capture an explicit list of urls

```bash
bdy tests capture --urls "https://example.com,https://example.com/about"
```

### Capture from a sitemap and follow links

```bash
bdy tests capture --sitemap https://example.com/sitemap.xml --follow
```

### Capture from a urls file and ignore a globbed selector

```bash
bdy tests capture --urlsFile ./urls.txt --ignore "header>.banner"
```


---
Original source: https://buddy.works/docs/cli/tests