Go to file
Rick e08c2046d5
feat: add a service commnd (#39)
* feat: add a service commnd

The following command will install atest as a Linux service. `atest service --action install`.

Set the default service port to be 7070 to avoid confliction

* add unit tests

* add more unit tests
2023-04-14 09:32:24 +08:00
.github feat: support to validate the response via JSON schema (#38) 2023-04-12 13:31:52 +08:00
cmd feat: add a service commnd (#39) 2023-04-14 09:32:24 +08:00
pkg feat: add a service commnd (#39) 2023-04-14 09:32:24 +08:00
sample feat: add a service commnd (#39) 2023-04-14 09:32:24 +08:00
.gitignore feat: add grpc server support (#22) 2023-04-04 13:18:51 +08:00
.goreleaser.yaml feat: support to run a specific test case via grpc (#28) 2023-04-05 18:59:08 +08:00
CONTRIBUTION.md feat: support output the test report (#17) 2023-04-01 19:00:50 +08:00
Dockerfile feat: support to set the log level (#33) 2023-04-08 18:27:21 +08:00
LICENSE Initial commit 2022-06-08 14:12:05 +08:00
Makefile fix the base image (#26) 2023-04-04 14:13:16 +08:00
README.md feat: support to validate the response via JSON schema (#38) 2023-04-12 13:31:52 +08:00
action.yml Add goreleaser config file 2022-06-09 11:09:01 +08:00
go.mod feat: add a service commnd (#39) 2023-04-14 09:32:24 +08:00
go.sum feat: add a service commnd (#39) 2023-04-14 09:32:24 +08:00
main.go feat: add a service commnd (#39) 2023-04-14 09:32:24 +08:00

README.md

Codacy Badge Codacy Badge GitHub All Releases

This is a API testing tool.

Feature

  • Response Body fields equation check
  • Response Body eval
  • Validate the response body with JSON schema
  • Output reference between TestCase
  • Run in server mode, and provide the gRPC endpoint
  • VS Code extension support

Get started

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 m

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

Template

The following fields are templated with sprig:

  • API
  • Request Body
  • Request Header

TODO

  • Reduce the size of context
  • Support customized context

Limit

  • Only support to parse the response body when it's a map or array