Skip to navigation

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:

{
"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.

Example

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

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