Skip to main content

config

Configuration options for Doc Detective operations.

Fields

FieldTypeDescriptionDefault
defaultCommandstringOptional. Default command to run when no command is specified.

Accepted values: runTests, runCoverage
inputOne of
- string
- array of strings
Optional. Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files..
outputstringOptional. Path of the of the file or directory in which to store the output of Doc Detective commands. If a file path is specified, the output is written to that file. If a file of that name already exists, Doc Detective creates appends an integer to the result file name. If a directory path is specified, the output file name is dependent on the command being run..
recursivebooleanOptional. If true searches input, setup, and cleanup paths recursively for test specifications and source files.true
relativePathBasestringOptional. Whether paths should be interpreted as relative to the current working directory (cwd) or to the file in which they're specified (file).

Accepted values: cwd, file
cwd
envVariablesstringOptional. Path to a .env file to load before performing a Doc Detective operation.
runTestsobjectOptional. Options for running tests. When running tests, values set here override general configuration options.
runTests.inputOne of
- string
- array of strings
Optional. Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.
runTests.outputstringOptional. Path of the of the file or directory in which to store the output of Doc Detective commands. If a file path is specified, the output is written to that file. If a file of that name already exists, Doc Detective creates appends an integer to the result file name. If a directory path is specified, the output file name is dependent on the command being run..
runTests.setupOne of
- string
- array of strings
Optional. Path(s) to test specifications to perform before those specified by input. Useful for setting up testing environments.
runTests.cleanupOne of
- string
- array of strings
Optional. Path(s) to test specifications to perform after those specified by input. Useful for cleaning up testing environments.
runTests.recursivebooleanOptional. If true searches input, setup, and cleanup paths recursively for test specifications and source files.
runTests.detectStepsbooleanOptional. Whether or not to detect steps in input files based on markup regex.false
runTests.mediaDirectorystringOptional. DEPRECATED..
runTests.downloadDirectorystringOptional. Path of the directory in which to store downloaded files..
runTests.contextsarray of object(context)Optional. Application/platform sets to run tests in. If no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it.[{"app":{"name":"firefox","options":{"width":1200,"height":800,"headless":true}},"platforms":["linux","mac","windows"]}]
runCoverageobjectOptional. Options for performing test coverage analysis on documentation source files. When performing coverage analysis, values set here override general configuration options.
runCoverage.inputOne of
- string
- array of strings
Optional. Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.
runCoverage.outputstringOptional. Path of the of the file or directory in which to store the output of Doc Detective commands. If a file path is specified, the output is written to that file. If a file of that name already exists, Doc Detective creates appends an integer to the result file name. If a directory path is specified, the output file name is dependent on the command being run..
runCoverage.recursivebooleanOptional. If true searches input, setup, and cleanup paths recursively for test specifications and source files.
runCoverage.markuparray of stringsOptional. Markup types to include when performing this operation. If no markup types are specified, the operation includes all markup types as defined in fileTypes.["onscreenText","emphasis","image","hyperlink","codeInline","codeBlock","interaction"]
suggestTestsobjectOptional. Options for suggesting tests based on documentation source files. When suggesting tests, values set here override general configuration options.
suggestTests.inputOne of
- string
- array of strings
Optional. Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.
suggestTests.outputstringOptional. Path of the of the file or directory in which to store the output of Doc Detective commands. If a file path is specified, the output is written to that file. If a file of that name already exists, Doc Detective creates appends an integer to the result file name. If a directory path is specified, the output file name is dependent on the command being run..
suggestTests.recursivebooleanOptional. If true searches input, setup, and cleanup paths recursively for test specifications and source files.
suggestTests.markuparray of stringsOptional. Markup types to include when performing this operation. If no markup types are specified, the operation includes all markup types as defined in fileTypes.["onscreenText","emphasis","image","hyperlink","codeInline","codeBlock","interaction"]
fileTypesarray of objectsOptional. Information on supported file types and how to parse the markup within them.[]
fileTypes.namestringOptional. Name of the file type.
fileTypes.extensionsarray of stringsRequired. File extensions to support with this configuration.
fileTypes.testStartStatementOpenstringRequired. Opening of an in-document test start statement.
fileTypes.testStartStatementClosestringRequired. Close of an in-document test start statement.
fileTypes.testIgnoreStatementstringRequired. Text for an in-document test ignore statement.
fileTypes.testEndStatementstringRequired. Text for an in-document test end statement.
fileTypes.stepStatementOpenstringRequired. Opening of an in-document step statement.
fileTypes.stepStatementClosestringRequired. Close of an in-document step statement.
fileTypes.markuparray of objectsRequired. Markup types and associated regex patterns to find in documentation source files.
fileTypes.markup.namestringRequired. Name of the markup type.
fileTypes.markup.regexarray of stringsRequired. Regex patterns to find the markup type in documentation source files.
fileTypes.markup.actionsarray of
- strings
- objects
- object(checkLink)
- object(find)
- object(goTo)
- object(httpRequest)
- object(runShell)
- object(saveScreenshot)
- object(setVariables)
- object(startRecording)
- object(stopRecording)
- object(typeKeys)
- object(wait)
Optional. Actions that apply to the markup type.
fileTypes.markup.actions.namestringRequired. Name of the action.

Accepted values: checkLink, find, goTo, httpRequest, runShell, saveScreenshot, setVariables, startRecording, stopRecording, typeKeys, wait
fileTypes.markup.actions.paramsobjectOptional. Parameters for the action.
integrationsobjectOptional. Options for connecting to external services.
telemetryobjectOptional. Options around sending telemetry for Doc Detective usage.{"send":true}
telemetry.sendbooleanRequired. If true, sends Doc Detective telemetry.true
telemetry.userIdstringOptional. Identifier for the organization, group, or individual running Doc Detective.
logLevelstringOptional. Amount of detail to output when performing an operation.

Accepted values: silent, error, warning, info, debug
info

Examples

{}
{
"input": ".",
"output": "."
}
{
"defaultCommand": "runTests",
"envVariables": "",
"input": ".",
"output": ".",
"recursive": true,
"logLevel": "info",
"runTests": {
"input": ".",
"output": ".",
"setup": "",
"cleanup": "",
"recursive": true,
"downloadDirectory": ".",
"contexts": [
{
"app": {
"name": "firefox",
"path": ""
},
"platforms": [
"linux",
"mac",
"windows"
]
}
]
}
}
{
"envVariables": "",
"input": ".",
"output": ".",
"recursive": true,
"logLevel": "info",
"runTests": {
"input": ".",
"output": ".",
"setup": "",
"cleanup": "",
"recursive": true,
"downloadDirectory": ".",
"contexts": [
{
"app": {
"name": "firefox",
"path": ""
},
"platforms": [
"linux",
"mac",
"windows"
]
}
]
},
"runCoverage": {
"recursive": true,
"input": ".",
"output": ".",
"markup": []
},
"fileTypes": [
{
"name": "Markdown",
"extensions": [
".md",
".markdown",
".mdx"
],
"testStartStatementOpen": "[comment]: # (test start",
"testStartStatementClose": ")",
"testIgnoreStatement": "[comment]: # (test ignore)",
"testEndStatement": "[comment]: # (test end)",
"stepStatementOpen": "[comment]: # (step",
"stepStatementClose": ")",
"markup": [
{
"name": "onscreenText",
"regex": [
"\\*\\*.+?\\*\\*"
],
"actions": [
"find"
]
},
{
"name": "emphasis",
"regex": [
"(?<!\\*)\\*(?!\\*).+?(?<!\\*)\\*(?!\\*)"
]
},
{
"name": "image",
"regex": [
"!\\[.+?\\]\\(.+?\\)"
],
"actions": [
"checkLink"
]
},
{
"name": "hyperlink",
"regex": [
"(?<!!)\\[.+?\\]\\(.+?\\)"
],
"actions": [
"checkLink"
]
},
{
"name": "navigationLink",
"regex": [
"(?:[Cc]hose|[Oo]pen|[Cc]lick|[Nn]avigate to|[Gg]o to)(?<!!)\\[.+?\\]\\(.+?\\)"
],
"actions": [
"goTo"
]
},
{
"name": "orderedList",
"regex": [
"(?<=\n) *?[0-9][0-9]?[0-9]?.\\s*.*"
]
},
{
"name": "unorderedList",
"regex": [
"(?<=\n) *?\\*.\\s*.*",
"(?<=\n) *?-.\\s*.*"
]
},
{
"name": "codeInline",
"regex": [
"(?<!`)`(?!`).+?(?<!`)`(?!`)"
]
},
{
"name": "codeBlock",
"regex": [
"(?=(```))(\\w|\\W)*(?<=```)"
]
},
{
"name": "interaction",
"regex": [
"[cC]lick",
"[tT]ap",
"[tT]ouch",
"[sS]elect",
"[cC]hoose",
"[tT]oggle",
"[eE]nable",
"[dD]isable",
"[tT]urn [oO][ff|n]",
"[tT]ype",
"[eE]nter",
"[sS]end",
"[aA]dd",
"[rR]emove",
"[dD]elete",
"[uU]pload",
"[dD]ownload",
"[sS]croll",
"[sS]earch",
"[fF]ilter",
"[sS]ort",
"[cC]opy",
"[pP]aste",
"[cC]ut",
"[rR]eplace",
"[cC]lear",
"[rR]efresh",
"[rR]evert",
"[rR]estore",
"[rR]eset",
"[lL]ogin",
"[lL]ogout",
"[sS]ign [iI]n",
"[sS]ign [oO]ut",
"[sS]ubmit",
"[cC]ancel",
"[cC]lose",
"[aA]ccept",
"[dD]ecline",
"[dD]eny",
"[rR]eject",
"[rR]etry",
"[rR]estart",
"[rR]esume"
]
}
]
}
],
"integrations": {},
"telemetry": {
"send": true,
"userId": "Doc Detective"
}
}
{
"envVariables": "",
"input": [
"."
],
"output": ".",
"recursive": true,
"relativePathBase": "cwd",
"logLevel": "info",
"runTests": {
"input": [
"."
],
"output": ".",
"setup": [
"."
],
"cleanup": [
"."
],
"recursive": true,
"downloadDirectory": ".",
"contexts": [
{
"app": {
"name": "firefox",
"options": {
"width": 1200,
"height": 800,
"headless": true
}
},
"platforms": [
"linux",
"mac",
"windows"
]
}
]
},
"runCoverage": {
"recursive": true,
"input": [
"."
],
"output": ".",
"markup": []
},
"fileTypes": [
{
"name": "Markdown",
"extensions": [
".md",
".markdown",
".mdx"
],
"testStartStatementOpen": "[comment]: # (test start",
"testStartStatementClose": ")",
"testIgnoreStatement": "[comment]: # (test ignore)",
"testEndStatement": "[comment]: # (test end)",
"stepStatementOpen": "[comment]: # (step",
"stepStatementClose": ")",
"markup": [
{
"name": "onscreenText",
"regex": [
"\\*\\*.+?\\*\\*"
],
"actions": [
"find"
]
},
{
"name": "emphasis",
"regex": [
"(?<!\\*)\\*(?!\\*).+?(?<!\\*)\\*(?!\\*)"
]
},
{
"name": "image",
"regex": [
"!\\[.+?\\]\\(.+?\\)"
],
"actions": [
"checkLink"
]
},
{
"name": "hyperlink",
"regex": [
"(?<!!)\\[.+?\\]\\(.+?\\)"
],
"actions": [
"checkLink"
]
},
{
"name": "navigationLink",
"regex": [
"(?:[Cc]hose|[Oo]pen|[Cc]lick|[Nn]avigate to|[Gg]o to)(?<!!)\\[.+?\\]\\(.+?\\)"
],
"actions": [
"goTo"
]
},
{
"name": "orderedList",
"regex": [
"(?<=\n) *?[0-9][0-9]?[0-9]?.\\s*.*"
]
},
{
"name": "unorderedList",
"regex": [
"(?<=\n) *?\\*.\\s*.*",
"(?<=\n) *?-.\\s*.*"
]
},
{
"name": "codeInline",
"regex": [
"(?<!`)`(?!`).+?(?<!`)`(?!`)"
]
},
{
"name": "codeBlock",
"regex": [
"(?=(```))(\\w|\\W)*(?<=```)"
]
},
{
"name": "interaction",
"regex": [
"[cC]lick",
"[tT]ap",
"[tT]ouch",
"[sS]elect",
"[cC]hoose",
"[tT]oggle",
"[eE]nable",
"[dD]isable",
"[tT]urn [oO][ff|n]",
"[tT]ype",
"[eE]nter",
"[sS]end",
"[aA]dd",
"[rR]emove",
"[dD]elete",
"[uU]pload",
"[dD]ownload",
"[sS]croll",
"[sS]earch",
"[fF]ilter",
"[sS]ort",
"[cC]opy",
"[pP]aste",
"[cC]ut",
"[rR]eplace",
"[cC]lear",
"[rR]efresh",
"[rR]evert",
"[rR]estore",
"[rR]eset",
"[lL]ogin",
"[lL]ogout",
"[sS]ign [iI]n",
"[sS]ign [oO]ut",
"[sS]ubmit",
"[cC]ancel",
"[cC]lose",
"[aA]ccept",
"[dD]ecline",
"[dD]eny",
"[rR]eject",
"[rR]etry",
"[rR]estart",
"[rR]esume"
]
}
]
},
{
"name": "AsciiDoc",
"extensions": [
".adoc",
".asciidoc, .asc"
],
"testStartStatementOpen": "// (test start",
"testStartStatementClose": ")",
"testIgnoreStatement": "// (test ignore)",
"testEndStatement": "// (test end)",
"stepStatementOpen": "// (step",
"stepStatementClose": ")",
"markup": []
},
{
"name": "HTML/XML",
"extensions": [
".html",
".htm",
".xml",
".xhtml"
],
"testStartStatementOpen": "<!-- test start",
"testStartStatementClose": "-->",
"testIgnoreStatement": "<!-- test ignore -->",
"testEndStatement": "<!-- test end -->",
"stepStatementOpen": "<!-- step",
"stepStatementClose": "-->",
"markup": []
}
],
"integrations": {},
"telemetry": {
"send": true,
"userId": "Doc Detective"
}
}