Appendix B. Use Case Document Schema
Permalink to Appendix B. Use Case Document SchemaThis appendix is normative.
The schema below is presented in JSON Schema form; the reference implementation uses an equivalent Zod schema. Both forms have the same meaning.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["id", "title", "type"],
"properties": {
"id": { "type": "string", "minLength": 1 },
"title": { "type": "string", "minLength": 1 },
"type": { "type": "string", "enum": ["positive", "negative"] },
"description": { "type": "string" },
"extends": { "type": "string" },
"preconditions": {
"type": "array",
"items": { "type": "string" },
"default": []
},
"start_location": { "type": "string" },
"expected_result": { "type": "string" },
"data": { "type": "object", "default": {} },
"scope": {
"type": "object",
"required": ["for_each"],
"properties": {
"for_each": { "type": "string", "minLength": 1 },
"concurrency": { "type": "integer", "exclusiveMinimum": 0 }
},
"additionalProperties": false
},
"steps": { "type": "array", "items": { "$ref": "#/$defs/stepEntry" } },
"steps_override": {
"type": "object",
"required": ["from_step", "steps"],
"properties": {
"from_step": { "type": "integer", "minimum": 1 },
"steps": { "type": "array", "items": { "$ref": "#/$defs/stepEntry" } }
},
"additionalProperties": false
},
"before": { "type": "array", "items": { "$ref": "#/$defs/stepEntry" } }
},
"$defs": {
"stepEntry": {
"description": "One step in either spelling of §4.5: a one-key mapping, or a bare `keyword: rest` string.",
"oneOf": [
{ "type": "string" },
{
"type": "object",
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": { "type": ["string", "number"] }
}
]
}
}
}
The configuration schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"browser": {
"type": "string",
"enum": ["chromium", "firefox", "webkit"],
"default": "chromium"
},
"headed": { "type": "boolean", "default": false },
"slow_mo": { "type": "number", "default": 0 },
"timeout": { "type": "integer", "minimum": 0, "default": 30000 },
"viewport": {
"type": "object",
"default": { "width": 1280, "height": 720 },
"properties": {
"width": { "type": "integer", "exclusiveMinimum": 0 },
"height": { "type": "integer", "exclusiveMinimum": 0 }
}
},
"continue_on_failure": { "type": "boolean", "default": true },
"screenshot_on_failure": { "type": "boolean", "default": true },
"screenshot_dir": { "type": "string", "default": "./screenshots" },
"report_formats": {
"type": "array",
"items": { "type": "string" },
"default": ["json"]
},
"report_dir": { "type": "string", "default": "./reports" },
"global_setup": { "type": "string" },
"data_files": {
"type": "array",
"items": { "type": "string" },
"default": []
},
"storage_state": { "type": "string" },
"blocked_hosts": {
"type": "array",
"items": { "type": "string" },
"default": []
}
}
}