Skip to navigation

step

A step in a test.

Referenced In

Fields

FieldTypeDescriptionDefault
$schemaunknownOptional. No description provided.—
resultunknownOptional. No description provided.—
resultDescriptionunknownOptional. No description provided.—
resultCodeunknownOptional. No description provided.—
resultHintunknownOptional. No description provided.—
stepIdunknownOptional. No description provided.—
descriptionunknownOptional. No description provided.—
unsafeunknownOptional. No description provided.—
outputsunknownOptional. No description provided.—
variablesunknownOptional. No description provided.—
ifunknownOptional. No description provided.—
assertionsunknownOptional. No description provided.—
onPassunknownOptional. No description provided.—
onFailunknownOptional. No description provided.—
onWarningunknownOptional. No description provided.—
onSkipunknownOptional. No description provided.—
locationunknownOptional. No description provided.—
autoScreenshotPathunknownOptional. No description provided.—
attemptsunknownOptional. No description provided.—
visitunknownOptional. No description provided.—
durationMsunknownOptional. No description provided.—
startedAtunknownOptional. No description provided.—
checkLinkunknownOptional. No description provided.—
clickunknownOptional. No description provided.—
findunknownOptional. No description provided.—
goTounknownOptional. No description provided.—
httpRequestunknownOptional. No description provided.—
runShellunknownOptional. No description provided.—
runCodeunknownOptional. No description provided.—
runBrowserScriptunknownOptional. No description provided.—
typeunknownOptional. No description provided.—
screenshotunknownOptional. No description provided.—
saveCookieunknownOptional. No description provided.—
recordunknownOptional. No description provided.—
stopRecordunknownOptional. No description provided.—
closeSurfaceunknownOptional. No description provided.—
startSurfaceunknownOptional. No description provided.—
loadVariablesunknownOptional. No description provided.—
dragAndDropunknownOptional. No description provided.—
loadCookieunknownOptional. No description provided.—
swipeunknownOptional. No description provided.—
waitunknownOptional. No description provided.—
annotateunknownOptional. No description provided.—

Examples

{
"stepId": "uuid",
"description": "Description of the step.",
"checkLink": "https://www.google.com",
"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
}
{
"swipe": "up"
}
{
"swipe": {
"from": {
"x": 200,
"y": 600
},
"to": {
"x": 200,
"y": 200
}
}
}
{
"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
}
{
"runShell": {
"command": "docker run -p 8080:80 nginx",
"background": {
"name": "web",
"waitUntil": {
"httpGet": "http://localhost:8080"
}
},
"timeout": 30000
}
}
{
"closeSurface": "web"
}
{
"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"
}
{
"saveCookie": "session_token"
}
{
"saveCookie": {
"name": "auth_cookie",
"path": "auth-session.txt",
"directory": "./test-data",
"overwrite": true
}
}
{
"loadCookie": "session_token"
}
{
"loadCookie": {
"name": "auth_cookie",
"path": "auth-session.txt",
"directory": "./test-data"
}
}
{
"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": "Submit"
}
{
"click": {
"button": "left",
"elementText": "Element text"
}
}
{
"click": {
"selector": "#elementToScreenshot",
"elementText": "Element text",
"button": "middle"
}
}
{
"httpRequest": "https://reqres.in/api/users"
}
{
"httpRequest": "$API_URL/users"
}
{
"httpRequest": {
"url": "https://reqres.in/api/users"
}
}
{
"httpRequest": {
"url": "/api/users",
"statusCodes": 200,
"request": {
"headers": "Accept: application/json\nAuthorization: Bearer $TOKEN"
}
}
}
{
"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"
}
}
}
{
"dragAndDrop": {
"source": {
"selector": "#sourceElement"
},
"target": {
"selector": "#targetElement"
}
}
}
{
"runBrowserScript": "return document.title;"
}
{
"runBrowserScript": {
"script": "return arguments[0] + arguments[1];",
"args": [
"foo",
"bar"
],
"output": "foobar"
}
}
{
"annotate": {
"add": [
{
"id": "step-1",
"badge": "#username",
"label": "1"
}
]
}
}
{
"annotate": {
"clear": true
}
}