Skip to content

Commit 541d510

Browse files
Documentation updates from Promptless
1 parent 778dcb1 commit 541d510

File tree

4 files changed

+707
-6
lines changed

4 files changed

+707
-6
lines changed

docs/get-started/tests/index.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,65 @@ npx doc-detective --input https://doc-detective.com/sample.spec.json
371371

372372
These tests run the same way as local tests, but Doc Detective fetches the test file from the specified URL and stores it in a temporary directory. The URL must be accessible to the machine running the tests.
373373

374+
## Debug mode
375+
376+
Doc Detective supports a debug mode that allows you to step through tests interactively and set breakpoints. This is particularly useful for debugging failing tests, understanding test execution flow, and developing new tests.
377+
378+
### Configuration
379+
380+
Configure debug mode using the `debug` property in your configuration:
381+
382+
```json
383+
{
384+
"input": "tests/",
385+
"debug": false
386+
}
387+
```
388+
389+
```json
390+
{
391+
"input": "tests/",
392+
"debug": true
393+
}
394+
```
395+
396+
```json
397+
{
398+
"input": "tests/",
399+
"debug": "stepThrough"
400+
}
401+
```
402+
403+
### Debug options
404+
405+
- `false` (default): Disables all debugging
406+
- `true`: Allows pausing on breakpoints, waiting for user input before continuing
407+
- `"stepThrough"`: Pauses at every step, waiting for user input before continuing
408+
409+
### Step-level breakpoints
410+
411+
You can set breakpoints directly on individual steps using the `breakpoint` property:
412+
413+
```json
414+
{
415+
"tests": [
416+
{
417+
"steps": [
418+
{
419+
"description": "Normal step",
420+
"wait": 1000
421+
},
422+
{
423+
"description": "Debug this step",
424+
"breakpoint": true,
425+
"click": "#submit"
426+
}
427+
]
428+
}
429+
]
430+
}
431+
```
432+
374433
## Read the results
375434

376435
Doc Detective outputs test results to a `testResults-<timestamp>.json` file in your `output` directory. You can also specify your output directory with the `--output` flag:

docs/references/schemas/config.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Configuration options for Doc Detective operations.
77

88
Field | Type | Description | Default
99
:-- | :-- | :-- | :--
10-
$schema | string | Optional. JSON Schema for this object.<br/><br/>Accepted values: `https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/config_v3.schema.json` |
1110
configId | string | Optional. Identifier for the configuration. |
1211
configPath | string | ReadOnly. Path to the configuration file. |
1312
input | one of:<br/>- string<br/>- array of string | Optional. Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files. | `.`
@@ -19,13 +18,13 @@ origin | string | Optional. Default protocol and domain to use for relative URLs
1918
beforeAny | one of:<br/>- string<br/>- array of string | Optional. Path(s) to test specifications to perform before those specified by `input`. Useful for setting up testing environments. |
2019
afterAll | one of:<br/>- string<br/>- array of string | Optional. Path(s) to test specifications to perform after those specified by `input`. Useful for cleaning up testing environments. |
2120
detectSteps | boolean | Optional. Whether or not to detect steps in input files based on defined markup. | `true`
22-
allowUnsafeSteps | boolean | Optional. Whether or not to run potentially unsafe steps, such as those that might modify files or system state. |
2321
logLevel | string | Optional. Amount of detail to output when performing an operation.<br/><br/>Accepted values: `silent`, `error`, `warning`, `info`, `debug` | `info`
22+
debug | one of:<br/>- boolean<br/>- string | Optional. Enable debugging mode. `true` allows pausing on breakpoints, waiting for user input before continuing. `"stepThrough"` pauses at every step, waiting for user input before continuing. `false` disables all debugging.<br/><br/>Accepted values: `false`, `true`, `"stepThrough"` | `false`
2423
runOn | array of object([context](/docs/references/schemas/context)) | Optional. Contexts to run the test in. Overrides contexts defined at the config and spec levels. |
25-
fileTypes | array of one of: string, object([File type (custom)](/docs/references/schemas/file-type-custom)), object([File type (executable)](/docs/references/schemas/file-type-executable)) | Optional. Configuration for file types and their markup detection. | ``["markdown","asciidoc","html"]``
26-
integrations | object([Integrations options](/docs/references/schemas/integrations-options)) | Optional. Options for connecting to external services. |
27-
telemetry | object([Telemetry options](/docs/references/schemas/telemetry-options)) | Optional. Options around sending telemetry for Doc Detective usage. | ``{"send":true}``
28-
environment | object([Environment details](/docs/references/schemas/environment-details)) | ReadOnly. Environment information for the system running Doc Detective. |
24+
fileTypes | array of one of: string, object([File type (custom)](/docs/references/schemas/File%20type%20(custom))), object([File type (executable)](/docs/references/schemas/File%20type%20(executable))) | Optional. Configuration for file types and their markup detection. | ``["markdown","asciidoc","html"]``
25+
integrations | object([Integrations options](/docs/references/schemas/Integrations%20options)) | Optional. Options for connecting to external services. |
26+
telemetry | object([Telemetry options](/docs/references/schemas/Telemetry%20options)) | Optional. Options around sending telemetry for Doc Detective usage. | ``{"send":true}``
27+
environment | object([Environment details](/docs/references/schemas/Environment%20details)) | ReadOnly. Environment information for the system running Doc Detective. |
2928

3029
## Examples
3130

@@ -118,3 +117,21 @@ environment | object([Environment details](/docs/references/schemas/environment-
118117
}
119118
}
120119
```
120+
121+
```json
122+
{
123+
"debug": false
124+
}
125+
```
126+
127+
```json
128+
{
129+
"debug": true
130+
}
131+
```
132+
133+
```json
134+
{
135+
"debug": "stepThrough"
136+
}
137+
```

0 commit comments

Comments
 (0)