Skip to main content

step

A step in a test.

Fields

Note: The following action properties are mutually exclusive. You can only use one of these in a single step:

checkLink, click, find, goTo, httpRequest, runShell, runCode, type, screenshot, record, stopRecord, loadVariables, wait

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.{}
checkLinkstringRequired. Check if an HTTP or HTTPS URL returns an acceptable status code from a GET request.

Pattern: `(^(http://
https://
checkLinkobjectRequired. Check if an HTTP or HTTPS URL returns an acceptable status code from a GET request.
checkLink.urlstringRequired. URL to check. Can be a full URL or a path. If a path is provided, origin must be specified.

Pattern: `(^(http://
https://
checkLink.originstringOptional. Protocol and domain to navigate to. Prepended to url.
checkLink.statusCodesintegerOptional. Accepted status codes. If the specified URL returns a code other than what is specified here, the action fails.
checkLink.statusCodesarray of integerOptional. Accepted status codes. If the specified URL returns a code other than what is specified here, the action fails.
clickstringRequired. Display text or selector of the element to find.
clickobjectRequired. Click or tap an element.
click.buttonstringOptional. Kind of click to perform.

Accepted values: left, right, middle
click.elementTextstringOptional. Display text of the element to click. If combined with selector, the element must match both the text and the selector.
click.selectorstringOptional. Selector of the element to click. If combined with elementText, the element must match both the text and the selector.
clickbooleanRequired. Click or tap an element.
findstringRequired. Display text or selector of the element to find.
findobjectRequired. Find an element based on display text or a selector, then optionally interact with it.
find.elementTextstringOptional. Display text of the element to find. If combined with selector, the element must match both the text and the selector.
find.selectorstringOptional. Selector of the element to find. If combined with elementText, the element must match both the text and the selector.
find.timeoutintegerOptional. Max duration in milliseconds to wait for the element to exist.5000
find.moveTobooleanOptional. Move to the element. If the element isn't visible, it's scrolled into view.true
find.clickobject(click)Optional. Click or tap an element.
find.clickobjectOptional. Click the element.
find.click.buttonstringOptional. Kind of click to perform.

Accepted values: left, right, middle
find.typeunknownOptional. Type keys after finding the element. Either a string or an object with a keys field as defined in type. To type in the element, make the element active with the click parameter.
goTostringRequired. Navigate to an HTTP or HTTPS URL. Can be a full URL or a path. If a path is provided, navigates relative to the current URL, if any.

Pattern: `(^(http://
https://
goToobjectRequired. Navigate to an HTTP or HTTPS URL.
goTo.urlstringRequired. URL to navigate to. Can be a full URL or a path. If a path is provided and origin is specified, prepends origin to url. If a path is provided but origin isn't specified, attempts to navigate relative to the current URL, if any.

Pattern: `(^(http://
https://
goTo.originstringOptional. Protocol and domain to navigate to. Prepended to url.
httpRequeststringRequired. URL for the HTTP request.

Pattern: `(^(http://
https://).*
httpRequestobjectRequired. Perform a generic HTTP request, for example to an API.
httpRequest.urlstringOptional. URL for the HTTP request.

Pattern: `(^(http://
https://).*
httpRequest.openApiunknownOptional. No description provided.
httpRequest.statusCodesarray of integerOptional. Accepted status codes. If the specified URL returns a code other than what is specified here, the action fails.[200,201]
httpRequest.methodstringOptional. Method of the HTTP request

Accepted values: get, put, post, patch, delete
get
httpRequest.timeoutintegerOptional. Timeout for the HTTP request, in milliseconds.60000
httpRequest.requestobjectOptional. No description provided.
httpRequest.request.headersobjectOptional. Headers to include in the HTTP request, in key/value format.{}
httpRequest.request.parametersobjectOptional. URL parameters to include in the HTTP request, in key/value format.{}
httpRequest.request.bodyobjectOptional. JSON object to include as the body of the HTTP request.
httpRequest.request.bodyarray of unknownOptional. JSON object to include as the body of the HTTP request.
httpRequest.request.bodystringOptional. JSON object to include as the body of the HTTP request.
httpRequest.responseobjectOptional. No description provided.
httpRequest.response.headersobjectOptional. Headers expected in the response, in key/value format. If one or more responseHeaders entries aren't present in the response, the step fails.{}
httpRequest.response.bodyobjectOptional. JSON object expected in the response. If one or more key/value pairs aren't present in the response, the step fails.
httpRequest.response.bodyarray of unknownOptional. JSON object expected in the response. If one or more key/value pairs aren't present in the response, the step fails.
httpRequest.response.bodystringOptional. JSON object expected in the response. If one or more key/value pairs aren't present in the response, the step fails.
httpRequest.allowAdditionalFieldsbooleanOptional. If false, the step fails when the response data contains fields not specified in the response body.true
httpRequest.pathstringOptional. File path to save the command's output, relative to directory. Specify a file extension that matches the expected response type, such as .json for JSON content or .txt for strings.
httpRequest.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.
httpRequest.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.

Minimum: 0. Maximum: 1
0
httpRequest.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
runShellstringRequired. Perform a native shell command.
runShellobjectRequired. Perform a native shell command.
runShell.commandstringRequired. Command to perform in the machine's default shell.
runShell.argsarray of stringOptional. Arguments for the command.[]
runShell.workingDirectorystringOptional. Working directory for the command..
runShell.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]
runShell.stdiostringOptional. Content expected in the command's stdout or stderr. If the expected content can't be found in the command's 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.*/.
runShell.pathstringOptional. File path to save the command's output, relative to directory.
runShell.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.
runShell.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.

Minimum: 0. Maximum: 1
0
runShell.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
runShell.timeoutintegerOptional. Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.60000
runCodeobjectRequired. Assemble and run code.
runCode.languagestringRequired. Language of the code to run.

Accepted values: python, bash, javascript
runCode.codestringRequired. 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.

Minimum: 0. Maximum: 1
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
typestringRequired. Sequence of keys to enter.
typearray of stringRequired. Sequence of keys to enter.
typeobjectRequired. 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.keysstringRequired. Sequence of keys to enter.
type.keysarray of stringRequired. 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.
screenshotstringRequired. File path of the PNG file. Accepts absolute paths. If not specified, the file name is the ID of the step.

Pattern: `([A-Za-z0-9_-]*.(png
PNG)$
screenshotobjectRequired. Takes a screenshot in PNG format.
screenshot.pathstringOptional. File path of the PNG file. Accepts absolute paths. If not specified, the file name is the ID of the step.

Pattern: `([A-Za-z0-9_-]*.(png
PNG)$
screenshot.directorystringOptional. Directory of the PNG file. If the directory doesn't exist, creates the directory.
screenshot.maxVariationnumberOptional. Allowed variation in percentage of pixels between the new screenshot and the existing screenshot at path. If the difference between the new screenshot and the existing screenshot is greater than maxVariation, the step fails. If a screenshot doesn't exist at path, this value is ignored.

Minimum: 0. Maximum: 1
0.05
screenshot.overwritestringOptional. If true, overwrites the existing screenshot at path if it exists.
If aboveVariation, overwrites the existing screenshot at path if the difference between the new screenshot and the existing screenshot is greater than maxVariation.

Accepted values: true, false, aboveVariation
aboveVariation
screenshot.cropstringOptional. Display text or selector of the element to screenshot.
screenshot.cropobjectOptional. Crop the screenshot to a specific element.
screenshot.crop.elementTextstringOptional. Display text of the element to screenshot.
screenshot.crop.selectorstringOptional. Selector of the element to screenshot.
screenshot.crop.paddingnumberOptional. Padding in pixels to add to the bounds of the element.

Minimum: 0
screenshot.crop.paddingobjectOptional. No description provided.
screenshot.crop.padding.topnumberOptional. No description provided.

Minimum: 0
screenshot.crop.padding.rightnumberOptional. No description provided.

Minimum: 0
screenshot.crop.padding.bottomnumberOptional. No description provided.

Minimum: 0
screenshot.crop.padding.leftnumberOptional. No description provided.

Minimum: 0
screenshotbooleanRequired. Takes a screenshot in PNG format.
recordstringRequired. File path of the recording. Supports the .mp4, .webm, and .gif extensions. If not specified, the file name is the ID of the step, and the extension is .mp4.

Pattern: `([A-Za-z0-9_-]*.(mp4
webm
recordobjectRequired. 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' ]
record.pathstringOptional. File path of the recording. Supports the .mp4, .webm, and .gif extensions. If not specified, the file name is the ID of the step, and the extension is .mp4.

Pattern: `([A-Za-z0-9_-]*.(mp4
webm
record.directorystringOptional. Directory of the file. If the directory doesn't exist, creates the directory.
record.overwritestringOptional. If true, overwrites the existing recording at path if it exists.

Accepted values: true, false
recordbooleanRequired. 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' ]
stopRecordbooleanRequired. Stop the current recording.
loadVariablesstringRequired. Load environment variables from the specified .env file.
waitnumberRequired. Pause (in milliseconds) before performing the next action.
waitstringRequired. Pause (in milliseconds) before performing the next action.

Pattern: (\$[A-Za-z0-9_]+)
waitbooleanRequired. Pause (in milliseconds) before performing the next action.

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"
}
}
}
}