Standalone tests
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
YAML
For comprehensive options, see
specification.
Editor support
Editors that read JSON Schema, such as VS Code, offer completion and validation. To turn that on, add a $schema property to a spec, step, context, or config. Doc Detective ignores the value when it runs. Your editor loads the schema from it. Point it at a schema file the editor can reach, such as the URL below or a local copy.
Swap spec_v3 for step_v3, context_v3, or config_v3 to match the file.
Example
Here’s an example test for performing a Google search and saving a screenshot of the results: