Skip to main content

Create a Test

To create a valid Test, you need to provide the test ID and at least one task. By incorporating multiple tasks, you can construct more complex and intricate test scenarios.

Example

tests.yml
tests:
sampleTest:
tasks:
- # Specify the action to be performed
action: actions.sampleHttpGetRequest
# Specify the validation script to validate the action's output
validate: scripts.validateHttpOk

actions:
sampleHttpGetRequest:
# Specify the type of action, in this case, an HTTP client request
type: HTTP::CLIENT
# Specify the properties for the HTTP request
props:
method: GET
fullUrl: https://httpbin.org/get

scripts:
validateHttpOk:
# Use an assertion to validate the status code from the previous action
assert context["last_output"]["statusCode"] == 200

Test Properties