This is a API testing tool.
- Response Body fields equation check
- Response Body eval
- Verify the Kubernetes resources
- Validate the response body with JSON schema
- Output reference between TestCase
- Run in server mode, and provide the gRPC endpoint
- VS Code extension support
Install it via hd or download from releases:
hd install atest
see the following usage:
API testing tool
Usage:
atest [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
json Print the JSON schema of the test suites struct
run Run the test suite
sample Generate a sample test case YAML file
server Run as a server mode
Flags:
-h, --help help for atest
-v, --version version for atest
Use "atest [command] --help" for more information about a command.
below is an example of the usage, and you could see the report as well:
atest run -p sample/testsuite-gitlab.yaml --duration 1m --thread 3 --report md
API | Average | Max | Min | Count | Error |
---|---|---|---|---|---|
GET https://gitlab.com/api/v4/projects | 1.152777167s | 2.108680194s | 814.928496ms | 99 | 0 |
GET https://gitlab.com/api/v4/projects/45088772 | 840.761064ms | 1.487285371s | 492.583066ms | 10 | 0 |
consume: 1m2.153686448s |
The following fields are templated with sprig:
- API
- Request Body
- Request Header
You could use all the common functions which comes from sprig. Besides some specific functions are available:
Name | Usage |
---|---|
randomKubernetesName |
{{randomKubernetesName}} to generate Kubernetes resource name randomly, the name will have 8 chars |
It could verify any kinds of Kubernetes resources. Please set the environment variables before using it:
KUBERNETES_SERVER
KUBERNETES_TOKEN
See also the example.
- Reduce the size of context
- Support customized context
- Only support to parse the response body when it's a map or array