Skip to main content

step

A step in a test.

Fields

FieldTypeDescriptionDefault
stepIdstringOptional. ID of the step.
descriptionstringOptional. Description of the step.
outputsobjectOptional. Outputs from step processes and user-defined expressions. Use the outputs object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.{}
variablesobjectOptional. Environment variables to set from user-defined expressions.{}
checkLinkOne of
- string
- object
Optional. No description provided.
clickOne of
- string([Find element (simple)](/docs/references/schemas/Find element (simple)))
- object([Click element (detailed)](/docs/references/schemas/Click element (detailed)))
- boolean
Optional. Click or tap an element.
findOne of
- string([Find element (simple)](/docs/references/schemas/Find element (simple)))
- object([Find element (detailed)](/docs/references/schemas/Find element (detailed)))
Optional. Find an element based on display text or a selector, then optionally interact with it.
goToOne of
- string
- object
Optional. No description provided.
httpRequestOne of
- string(URL)
- object
Optional. Perform a generic HTTP request, for example to an API.
runShellOne of
- string
- object
Optional. Perform a native shell command.
runCodeobjectOptional. Assemble and run code.
runCode.languagestringOptional. Language of the code to run.

Accepted values: python, bash, javascript
runCode.codestringOptional. Code to run.
runCode.argsarray of stringOptional. Arguments for the command.[]
runCode.workingDirectorystringOptional. Working directory for the command..
runCode.exitCodesarray of integerOptional. Expected exit codes of the command. If the command's actual exit code isn't in this list, the step fails.[0]
runCode.stdiostringOptional. Content expected in the command's output. If the expected content can't be found in the command's output (either stdout or stderr), the step fails. Supports strings and regular expressions. To use a regular expression, the string must start and end with a forward slash, like in /^hello-world.*/.
runCode.pathstringOptional. File path to save the command's output, relative to directory.
runCode.directorystringOptional. Directory to save the command's output. If the directory doesn't exist, creates the directory. If not specified, the directory is your media directory.
runCode.maxVariationnumberOptional. Allowed variation in percentage of text different between the current output and previously saved output. If the difference between the current output and the previous output is greater than maxVariation, the step fails. If output doesn't exist at path, this value is ignored.0
runCode.overwritestringOptional. If true, overwrites the existing output at path if it exists.
If aboveVariation, overwrites the existing output at path if the difference between the new output and the existing output is greater than maxVariation.

Accepted values: true, false, aboveVariation
aboveVariation
runCode.timeoutintegerOptional. Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.60000
typeobjectOptional. Type keys. To type special keys, begin and end the string with $ and use the special key's keyword. For example, to type the Escape key, enter $ESCAPE$.
type.keysOne of
- string
- array of string
Optional. Sequence of keys to enter.
type.inputDelaynumberOptional. Delay in milliseconds between each key press during a recording100
type.selectorstringOptional. Selector for the element to type into. If not specified, the typing occurs in the active element.
screenshotOne of
- string
- object
- boolean
Optional. Takes a screenshot in PNG format.
recordOne of
- string
- object
- boolean
Optional. Start recording the current browser viewport. Must be followed by a stopRecord step. Only runs in Chrome browsers when they are visible. Supported extensions: [ '.mp4', '.webm', '.gif' ]
stopRecordbooleanOptional. Stop the current recording.
loadVariablesstringOptional. Load environment variables from the specified .env file.
waitOne of
- number
- string
- boolean
Optional. Pause (in milliseconds) before performing the next action.5000

Examples

{
"stepId": "uuid",
"description": "Description of the step.",
"checkLink": "https://www.google.com",
"outputs": {
"outputKey": "outputValue"
},
"variables": {
"variableKey": "variableValue"
}
}
{
"checkLink": "https://www.google.com"
}
{
"stepId": "path-only",
"checkLink": "/search"
}
{
"stepId": "status-code",
"checkLink": {
"url": "https://www.google.com",
"statusCodes": [
200
]
}
}
{
"goTo": {
"url": "https://www.google.com"
}
}
{
"goTo": "https://www.google.com"
}
{
"wait": 5000
}
{
"runCode": {
"language": "python",
"code": "print('Hello from Python')",
"workingDirectory": ".",
"exitCodes": [
0
],
"stdio": "Hello from Python!",
"path": "python-output.txt",
"directory": "output",
"maxVariation": 0.1,
"overwrite": "aboveVariation"
}
}
{
"stopRecord": true
}
{
"screenshot": true
}
{
"screenshot": "image.png"
}
{
"screenshot": "static/images/image.png"
}
{
"screenshot": "/User/manny/projects/doc-detective/static/images/image.png"
}
{
"screenshot": {
"path": "image.png",
"directory": "static/images",
"maxVariation": 0.1,
"overwrite": "aboveVariation",
"crop": "#elementToScreenshot"
}
}
{
"screenshot": {
"path": "image.png",
"directory": "static/images",
"maxVariation": 0.1,
"overwrite": "aboveVariation"
}
}
{
"screenshot": {
"path": "image.png",
"directory": "static/images",
"maxVariation": 0.1,
"overwrite": "aboveVariation",
"crop": {
"selector": "#elementToScreenshot",
"elementText": "Element text",
"padding": {
"top": 0,
"right": 0,
"bottom": 0,
"left": 0
}
}
}
}
{
"record": true
}
{
"record": "video.mp4"
}
{
"record": "static/media/video.mp4"
}
{
"record": "/User/manny/projects/doc-detective/static/media/video.mp4"
}
{
"record": {
"path": "video.mp4",
"directory": "static/media",
"overwrite": true
}
}
{
"loadVariables": "variables.env"
}
{
"find": "Find me!"
}
{
"find": {
"selector": "[title=Search]"
}
}
{
"find": {
"selector": "[title=Search]",
"timeout": 10000,
"elementText": "Search",
"moveTo": true,
"click": true,
"type": "shorthair cat"
}
}
{
"find": {
"selector": "[title=Search]",
"click": {
"button": "right"
}
}
}
{
"find": {
"selector": "[title=Search]",
"timeout": 10000,
"elementText": "Search",
"moveTo": true,
"click": true,
"type": {
"keys": [
"shorthair cat"
],
"inputDelay": 100
}
}
}
{
"click": true
}
{
"click": "right"
}
{
"click": {
"button": "left",
"elementText": "Element text"
}
}
{
"click": {
"selector": "#elementToScreenshot",
"elementText": "Element text",
"button": "middle"
}
}
{
"httpRequest": "https://reqres.in/api/users"
}
{
"httpRequest": {
"url": "https://reqres.in/api/users"
}
}
{
"httpRequest": {
"url": "https://reqres.in/api/users/2",
"method": "put",
"request": {
"body": {
"name": "morpheus",
"job": "zion resident"
}
}
}
}
{
"httpRequest": {
"url": "https://reqres.in/api/users",
"method": "post",
"request": {
"body": {
"name": "morpheus",
"job": "leader"
}
},
"response": {
"body": {
"name": "morpheus",
"job": "leader"
}
},
"statusCodes": [
200,
201
]
}
}
{
"httpRequest": {
"url": "https://www.api-server.com",
"method": "post",
"timeout": 30000,
"request": {
"body": {
"field": "value"
},
"headers": {
"header": "value"
},
"parameters": {
"param": "value"
}
},
"response": {
"body": {
"field": "value"
},
"headers": {
"header": "value"
}
},
"statusCodes": [
200
]
}
}
{
"httpRequest": {
"url": "https://reqres.in/api/users",
"method": "post",
"request": {
"body": {
"name": "morpheus",
"job": "leader"
}
},
"response": {
"body": {
"name": "morpheus",
"job": "leader"
}
},
"statusCodes": [
200,
201
],
"path": "response.json",
"directory": "media",
"maxVariation": 0.05,
"overwrite": "aboveVariation"
}
}
{
"httpRequest": {
"openApi": "getUserById"
}
}
{
"httpRequest": {
"openApi": {
"name": "Reqres",
"operationId": "getUserById"
},
"request": {
"parameters": {
"id": 123
}
}
}
}
{
"httpRequest": {
"openApi": {
"descriptionPath": "https://api.example.com/openapi.json",
"operationId": "getUserById"
},
"request": {
"parameters": {
"id": 123
}
}
}
}
{
"httpRequest": {
"openApi": {
"descriptionPath": "https://api.example.com/openapi.json",
"operationId": "createUser",
"useExample": "both"
}
}
}
{
"httpRequest": {
"openApi": {
"descriptionPath": "https://api.example.com/openapi.json",
"operationId": "updateUser",
"useExample": "request",
"exampleKey": "acme"
}
}
}
{
"httpRequest": {
"openApi": {
"descriptionPath": "https://api.example.com/openapi.json",
"operationId": "updateUser",
"useExample": "request",
"exampleKey": "acme",
"headers": {
"Authorization": "Bearer $TOKEN"
}
}
}
}