Skip to navigation

Common

Referenced In

Fields

FieldTypeDescriptionDefault
$schemastringOptional. JSON Schema URL for editor support. Doc Detective ignores it.

Minimum length: 1
—
stepIdstringOptional. ID of the step.—
descriptionstringOptional. Description of the step.—
unsafebooleanOptional. Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the allowUnsafeSteps config property or the --allow-unsafe flag.false
outputsobjectOptional. The values this step produced, keyed by name, such as exitCode or stdio. Present only in test results. Doc Detective populates it, and a value set in a spec does nothing. To keep a value for later steps, capture it with variables.{}
resultstringReadOnly. Outcome of this step. Doc Detective populates it. You never set it yourself.

Accepted values: PASS, FAIL, WARNING, SKIPPED
—
resultDescriptionstringReadOnly. Why this step had its outcome. Doc Detective populates it. You never set it yourself.—
resultCodestringReadOnly. What kind of failure this was, present only when result is FAIL. environment means the network, the browser session, or the page load failed. drift means the element wasn’t found, but similar ones were, so the page probably changed. assertion means anything else. Doc Detective populates it. You never set it yourself.

Accepted values: environment, drift, assertion
—
resultHintstringReadOnly. A suggested fix for a failed step, such as the closest elements to one a find couldn’t locate. Present only when Doc Detective has a suggestion. Doc Detective populates it. You never set it yourself.—
variablesobjectOptional. Environment variables to set from user-defined expressions.{}
ifone of:
- string
- array of string
Optional. A condition expression, or an array of expressions combined with logical AND.—
assertionsone of:
- one of:
- string
- array of string
- array of object(assertion)
Optional. Assertions for this step. As authored input, a custom condition expression (or array of expressions, combined with logical AND). In a test result, the runner replaces this with the array of articulated assertion records it evaluated (implicit then custom).—
onPassarray of object(Step routing)Optional. Routing entries evaluated when this step passes. The first entry whose if matches applies. Each entry is one of continue, stop: "test", retry, or goToStep.—
onFailarray of object(Step routing)Optional. Routing entries evaluated when this step fails. The first entry whose if matches applies; the default when none is set stops the test. Each entry is one of continue, stop: "test", retry, or goToStep.—
onWarningarray of object(Step routing)Optional. Routing entries evaluated when this step produces a warning. The first entry whose if matches applies. Each entry is one of continue, stop: "test", retry, or goToStep.—
onSkiparray of object(Step routing)Optional. Routing entries evaluated when this step is SKIPPED: its action ran and reported SKIPPED (such as wait: false), or it was skipped before running because its if was false or it’s an unsafe step that isn’t allowed. A step skipped because an earlier step stopped the test fires no handler. The first entry whose if matches applies. Each entry is one of continue, stop: "test", retry, or goToStep. retry re-runs only a step whose action ran and reported SKIPPED. For a step skipped before running, retry entries are passed over and the next matching entry applies.—
locationobject(Source Location)ReadOnly. Source location where this step was detected in the original file. This is system-populated metadata and should not be set manually.—
autoScreenshotPathstringReadOnly. Path, relative to the run’s artifact directory (the report’s runDir), of the screenshot captured automatically after this step. Always a non-empty, forward-slash, relative path. Present only in test results, when the test’s autoScreenshot setting is on and the capture succeeded. To turn automatic screenshots off, set autoScreenshot on the test, spec, or config, not on a step. This is system-populated metadata and should not be set manually.

Minimum length: 1. Pattern: `^(?![A-Za-z]:
[\/])[^\]+$`
attemptsintegerReadOnly. Total number of times this step ran (the initial attempt plus retries) when a routing retry action re-ran it. Present only in test results, and only when the step was retried at least once (so the value is always >= 2). The routing entry’s retry.limit caps the retries. Not the same as the config and context retries field, which re-runs a whole context on a new session. This is system-populated metadata and should not be set manually.

Minimum: 2
—
visitintegerReadOnly. Which visit of this step produced this report, when a routing goToStep re-ran it (the first visit omits this field). Present only in test results; system-populated.

Minimum: 2
—
durationMsintegerReadOnly. Wall-clock duration of this step in milliseconds. When a routing retry action re-ran the step, this is the FINAL attempt’s elapsed time — the attempt the reported result describes — not the sum across attempts. A step that was skipped or never executed reports 0. Distinct from the duration input that some actions accept (for example a click’s press duration). Present only in test results; system-populated.

Minimum: 0
—
startedAtstringReadOnly. When this step started, as an ISO 8601 UTC timestamp with milliseconds. When a routing retry action re-ran the step, this is the FINAL attempt’s start, matching durationMs. Absent for a step that was skipped or never executed. Present only in test results; system-populated.—

Examples

{
"$schema": "example",
"stepId": "example",
"description": "example",
"unsafe": false,
"outputs": {},
"variables": {},
"if": "example",
"assertions": "example",
"onPass": [],
"onFail": [],
"onWarning": [],
"onSkip": []
}