Case
The Cursion CLI has 2 commands to work with the Case
object:
Command | Description |
---|---|
run-case | run a case for a specific site |
get-caseruns | get one or more caseruns |
Tips
For information about the CaseRun
object, please see CaseRun Overview.
Run a Case
run-case
This command will create a new CaseRun
object for a Site
object associated with the passed <site-id>
. This command runs synchronously in the terminal and will resolve with a success message or raise an Exception if the resulting CaseRun.status
is failed
. Ideally, this command is designed for use in a CI/CD action - terminating the run if a CaseRun
"fails".
The full command to run a CaseRun
of a Site
is the following:
cursion run-case <site-id> <case-id>
Tips
To pass updated values to the CaseRun, use the following notation:
cursion run-case <site-id> <case-id> step-1:<value> step-2:<value>
View Full Output
checking site availablity...
✔ site is available
adjusting step data...
✔ step data updated
waiting for CaseRun completion...
✔ caserun completed -> bcfddb93-22ed-47ce-8d30-1488d1cd0abd
CaseRun results:
✔ Passed : https://app.cursion.dev/caserun/bcfddb93-22ed-47ce-8d30-1488d1cd0abd
Retrieve CaseRun
get-caseruns
This command will retrieve one or more CaseRun
objects associated with the passed --site-id=<site-id>
or --caserun-id=<caserun-id>
.
The full command to retrieve a CaseRun
is the following:
cursion get-caseruns --caserun-id=<caserun-id>
View Full Output
✔ Success
{
"id": "dd1f4670-8547-4fa8-8000-55c8e2dc20be",
"site": "c1ebc475-b214-4a31-99f2-cb875ea1c185",
"time_created": "2022-06-30T16:42:33.888151Z",
"time_completed": "2022-06-30T16:44:00.660156Z",
"case": "e458dbb0-0d29-4d01-a67a-b39899614504",
"title": "contact form",
"tags": ["tag1", "tag2"],
"passed": true,
"configs": {
"device": "desktop",
"window_size": "1920,1080",
"max_wait_time": "30",
"min_wait_time": 10
},
"steps": [
{
"action": {
"key": "",
"path": "/",
"type": "navigate",
"value": "",
"passed": true,
"element": "",
"exception": null,
"time_created": "2022-06-30 16:42:34.398921",
"time_completed": "2022-06-30 16:42:49.900984"
},
"assertion" :{
"type": "",
"value": "",
"passed": null,
"element": "",
"exception": null,
"time_created": null,
"time_completed": null
}
},
{
"action": {
"key": "",
"path": "",
"type": "change",
"value": "My Company inc",
"passed": true,
"element": "#leadCapCompany",
"exception": null,
"time_created": "2022-06-30 16:43:40.467322",
"time_completed": "2022-06-30 16:43:50.559047"
},
"assertion": {
"text": "Can we grab your info real quick?",
"type": "match",
"value": "Can we grab your info real quick?",
"passed": true,
"element": "#layoutDefault_content > main > header > div.page-header-content > div > div > div:nth-child(1) > h1",
"exception": null,
"time_created": "2022-06-30 16:43:50.568624",
"time_completed": "2022-06-30 16:43:50.579592"
}
},
# SHOETENED FOR DISPLAY PURPOSES
],
}