Skip to main content

test

A Doc Detective test.

Fields

FieldTypeDescriptionDefault
idstringOptional. Unique identifier for the test.Generated UUID
descriptionstringOptional. Description of the test.
filestringOptional. Path to the file that the test is associated with.
detectStepsbooleanOptional. Whether or not to detect steps in input files based on markup regex. Defaults to true.
contextsarray of object(context)Optional. Application/platform sets to run the test in. Overrides contexts defined at the config-level and spec-level.
setupstringOptional. Path to a test specification to perform before this test, while maintaining this test's context. Useful for setting up testing environments. Only the steps property is used from the first test in the setup spec.
cleanupstringOptional. Path to a test specification to perform after this test, while maintaining this test's context. Useful for cleaning up testing environments. Only the steps property is used from the first test in the cleanup spec.
stepsarray of
- object(checkLink)
- object(goTo)
- object(httpRequest)
- object(runShell)
- object(saveScreenshot)
- object(setVariables)
- object(startRecording)
- object(stopRecording)
- object(typeKeys)
- object(find)
- object(wait)
Required. Actions to perform as part of the test. Performed in the sequence defined. If one or more actions fail, the test fails.

Examples

{
"steps": [
{
"action": "checkLink",
"url": "https://www.duckduckgo.com"
}
]
}
{
"steps": [
{
"action": "goTo",
"url": "https://www.duckduckgo.com"
},
{
"action": "find",
"selector": "[title=Search]",
"click": true,
"typeKeys": {
"keys": [
"shorthair cats",
"$ENTER$"
]
}
}
]
}
{
"id": "Do all the things! - Test",
"description": "This test includes every property across all actions.",
"contexts": [
{
"app": {
"name": "firefox",
"path": "/usr/bin/firefox"
},
"platforms": [
"linux"
]
}
],
"setup": "setup.json",
"cleanup": "cleanup.json",
"steps": [
{
"action": "setVariables",
"path": ".env"
},
{
"action": "runShell",
"command": "echo",
"args": [
"$USER"
]
},
{
"action": "checkLink",
"url": "https://www.duckduckgo.com"
},
{
"action": "httpRequest",
"url": "https://reqres.in/api/users",
"method": "post",
"requestData": {
"name": "morpheus",
"job": "leader"
},
"responseData": {
"name": "morpheus",
"job": "leader"
},
"statusCodes": [
200,
201
]
},
{
"action": "goTo",
"url": "https://www.duckduckgo.com"
},
{
"action": "find",
"selector": "[title=Search]",
"timeout": 10000,
"matchText": "Search",
"moveTo": true,
"click": true,
"typeKeys": {
"keys": [
"shorthair cat"
]
}
},
{
"action": "typeKeys",
"keys": [
"$ENTER$"
]
},
{
"action": "saveScreenshot"
}
]
}