Use this command to execute API tests described in an Arazzo description.
The respect command supports Arazzo 1.0.1 descriptions. Of the features added in Arazzo 1.1.0, it supports only the parameters field of success and failure actions. When an action references a workflow with workflowId, respect passes the action's parameters to that workflow as inputs.
npx @redocly/cli@latest respect <your-test-file | multiple files | files bash query> [-w | --workflow] [-s | --skip] [-v | --verbose] [-i | --input] [-S | --server] [-H | --har-output] [-J | --json-output] [--max-steps] [--max-fetch-timeout] [--execution-timeout] [--severity] [--no-secrets-masking]
| Option | Type | Description |
|---|---|---|
-w, --workflow | [string] | Workflow names from the test file to run. For example, the following command runs "first-flow" and "second-flow" workflows from the
The |
-s, --skip | [string] | Workflow names from the test file to skip. For example, the following command skips the "first-flow" workflow from the
Warning The |
-v, --verbose | boolean | Runs the command in verbose mode to help with troubleshooting issues. For example, the following command runs all workflows from the
|
--har-output | string | Path for the
|
--json-output | string | Path for the JSON file for saving logs. For example, the following command runs all workflows from the
|
--input | string | Input parameters with values that are mapped to the workflow inputs description. For example, the following command maps the "userEmail" and "userPassword" inputs and values to all workflows in the
You can also use an environment variable to set the input, as in the following example:
You can also include nested values. The following example command maps the
You can also use an environment variable to set the input, as in the following example:
|
--server | string | Server overrides for the
You can also pass multiple server overrides as an environment variable by separating them with commas, as in the following example:
|
--severity | string | Severity of the check. Customize the severity level of validation checks for status codes, schemas, and content types. Setting the severity level is useful when:
The following checks can be configured:
The following severity values are available:
Setting the severity of a check to For example, the following command sets status code errors to the warning severity level:
|
--max-steps | number | Maximum number of steps to run (default: 2000). For example, the following command sets the maximum number of steps to 50:
You can also pass the maximum number of steps as an environment variable, as in the following example:
|
--max-fetch-timeout | number | Maximum time to wait for API response per request in milliseconds (default: 40 seconds). For example, the following command sets the maximum fetch timeout to 60 seconds:
You can also pass the maximum time to wait as an environment variable, as in the following example:
|
--execution-timeout | number | Maximum time to wait for the Respect execution in milliseconds (default: 1 hour). For example, the following command sets the execution timeout to 30 minutes:
You can also pass the maximum time to wait as an environment variable, as in the following example:
|
--no-secrets-masking | boolean | Disables masking of secrets in the output. By default, When this flag is set to For example, the following command disables sensitive output masking:
|
A step that calls an operation doesn't have to list its parameters or request body. When the step leaves them out, respect takes them from the OpenAPI description:
- Without
parameters, the step sends the operation's required parameters, including the ones defined on the path. - Without
requestBody, the step sends a body for the first media type of the operation's request body.
Each value comes from the example field, or from the first entry in examples (its value or, in OpenAPI 3.2, its dataValue). Without an example, respect generates a value from the schema.
For example, if the orderId path parameter of getOrderById has the example ord_01h1s5z6vf2mm1mz3hevnn9va7, the following step sends GET /orders/ord_01h1s5z6vf2mm1mz3hevnn9va7:
steps:
- stepId: get-order
operationId: getOrderById
A step that lists any parameters takes no parameters from the description. List every required parameter in that step.
- Run the tests by running the following command:
npx @redocly/cli@latest respect <your-test-file>. - Run multiple tests by running the following command:
npx @redocly/cli@latest respect <your-test-file-one> <your-test-file-two>. - Run multiple tests by running the following command with bash selector :
npx @redocly/cli@latest respect $(find ./path-to-tests-folder -type f -name '*.arazzo.yaml').
Example output
Running workflow warp.arazzo.yaml / missionLostInvention
✓ POST /anchors - step setAnchorToCurrentTime
✓ status code check (Response code 201 matches one of description codes: [201, 409])
✓ content-type check
✓ schema check
✓ POST /timelines - step createTimelineTo1889
✓ status code check (Response code 201 matches one of description codes: [201])
✓ content-type check
✓ schema check
✓ POST /travels - step travelTo1889
✓ status code check (Response code 200 matches one of description codes: [200, 400])
✓ content-type check
✓ schema check
✓ POST /items - step findAndRegisterBlueprint
✓ status code check (Response code 200 matches one of description codes: [200, 409])
✓ content-type check
✓ schema check
✓ POST /paradox-checks - step avoidParadox
✓ success criteria check
✓ success criteria check
✓ status code check (Response code 200 matches one of description codes: [200, 400])
✓ content-type check
✓ schema check
✓ POST /travels - step returnToPresent
✓ status code check (Response code 200 matches one of description codes: [200, 400])
✓ content-type check
✓ schema check
Summary for warp.arazzo.yaml
Workflows: 1 passed, 1 total
Steps: 6 passed, 6 total
Checks: 20 passed, 20 total
Time: 1060ms
┌──────────────────────────────────────────────────────────┬────────────┬─────────┬─────────┬──────────┬─────────┐
│ Filename │ Workflows │ Passed │ Failed │ Warnings │ Skipped │
├──────────────────────────────────────────────────────────┼────────────┼─────────┼─────────┼──────────┼─────────┤
│ ✓ warp.arazzo.yaml │ 1 │ 1 │ - │ - │ - │
└──────────────────────────────────────────────────────────┴────────────┴─────────┴─────────┴──────────┴─────────┘
- Learn more about using mTLS with Respect in Use mTLS.
- Follow steps to test API sequences in Test a sequence of API calls.
- Learn what Respect is and how you can use it to test API in the Respect concept document.
- Learn Arazzo.