> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# Standalone tests

> Define tests in standalone JSON or YAML files for machine-readable test specifications.

Standalone JSON or YAML files help you see the entirety of the spec and keep it in a separate, machine-readable format. They're useful for:

* Complex test suites that need version control
* Automated test generation and processing
* Integration with CI/CD pipelines
* Sharing tests across projects

However, they make it harder to maintain strict parallelism with documentation, so consider your use case carefully.

Test specs in standalone JSON or YAML files use the following basic structure:

#### JSON

```json
{
  "specId": "spec-id",
  "description": "Spec Description",
  "tests": [
    {
      "testId": "test-id",
      "description": "Test Description",
      "steps": [
        {
          "stepId": "step-id",
          "description": "Step description. This object also needs additional step properties like `find`, `goTo`, or `httpRequest`."
        }
      ]
    }
  ]
}
```

#### YAML

```yaml
specId: spec-id
description: Spec Description
tests:
- testId: test-id
  description: Test Description
  steps:
  - stepId: step-id
    description: Step description. This object also needs additional step properties
      like `find`, `goTo`, or `httpRequest`.
```

> For comprehensive options, see [`specification`](/reference/schemas/specification).

## Example

Here's an example test for performing a Google search and saving a screenshot of the results:

#### JSON

```json
{
  "tests": [
    {
      "steps": [
        {
          "goTo": "https://www.google.com"
        },
        {
          "find": {
            "selector": "[title=Search]",
            "click": true
          }
        },
        {
          "type": ["American Shorthair kittens", "$ENTER$"]
        },
        {
          "wait": 5000
        },
        {
          "screenshot": "search-results.png"
        }
      ]
    }
  ]
}
```

#### YAML

```yaml
tests:
- steps:
  - goTo: https://www.google.com
  - find:
      selector: "[title=Search]"
      click: true
  - type:
    - American Shorthair kittens
    - "$ENTER$"
  - wait: 5000
  - screenshot: search-results.png

```