|
1 |
| -[](https://www.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=github.com&utm_medium=referral&utm_content=LinuxSuRen/api-testing&utm_campaign=Badge_Grade) |
2 |
| -[](https://www.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=github.com&utm_medium=referral&utm_content=LinuxSuRen/api-testing&utm_campaign=Badge_Coverage) |
| 1 | +[](https://www.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=LinuxSuRen/api-testing\&utm_campaign=Badge_Grade) |
| 2 | +[](https://www.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=LinuxSuRen/api-testing\&utm_campaign=Badge_Coverage) |
3 | 3 | 
|
4 | 4 |
|
5 | 5 | This is a API testing tool.
|
6 | 6 |
|
7 | 7 | ## Feature
|
8 |
| -* Response Body fields equation check |
9 |
| -* Response Body [eval](https://expr.medv.io/) |
10 |
| -* Output reference between TestCase |
11 |
| -* Run in server mode, and provide the gRPC endpoint |
12 |
| -* [VS Code extension](https://github.com/LinuxSuRen/vscode-api-testing) support |
| 8 | + |
| 9 | +* Response Body fields equation check |
| 10 | +* Response Body [eval](https://expr.medv.io/) |
| 11 | +* Validate the response body with [JSON schema](https://json-schema.org/) |
| 12 | +* Output reference between TestCase |
| 13 | +* Run in server mode, and provide the gRPC endpoint |
| 14 | +* [VS Code extension](https://github.com/LinuxSuRen/vscode-api-testing) support |
| 15 | + |
| 16 | +## Get started |
| 17 | + |
| 18 | +Install it via [hd](https://github.com/LinuxSuRen/http-downloader) or download from [releases](https://github.com/LinuxSuRen/api-testing/releases): |
| 19 | + |
| 20 | +```shell |
| 21 | +hd install atest |
| 22 | +``` |
| 23 | + |
| 24 | +see the following usage: |
| 25 | + |
| 26 | +```shell |
| 27 | +API testing tool |
| 28 | + |
| 29 | +Usage: |
| 30 | + atest [command] |
| 31 | + |
| 32 | +Available Commands: |
| 33 | + completion Generate the autocompletion script for the specified shell |
| 34 | + help Help about any command |
| 35 | + json Print the JSON schema of the test suites struct |
| 36 | + run Run the test suite |
| 37 | + sample Generate a sample test case YAML file |
| 38 | + server Run as a server mode |
| 39 | + |
| 40 | +Flags: |
| 41 | + -h, --help help for atest |
| 42 | + -v, --version version for atest |
| 43 | + |
| 44 | +Use "atest [command] --help" for more information about a command. |
| 45 | +``` |
| 46 | +
|
| 47 | +below is an example of the usage, and you could see the report as well: |
| 48 | +
|
| 49 | +`atest run -p sample/testsuite-gitlab.yaml --duration 1m --thread 3 --report m` |
| 50 | +
|
| 51 | +| API | Average | Max | Min | Count | Error | |
| 52 | +|---|---|---|---|---|---| |
| 53 | +| GET https://gitlab.com/api/v4/projects | 1.152777167s | 2.108680194s | 814.928496ms | 99 | 0 | |
| 54 | +| GET https://gitlab.com/api/v4/projects/45088772 | 840.761064ms | 1.487285371s | 492.583066ms | 10 | 0 | |
| 55 | +consume: 1m2.153686448s |
13 | 56 |
|
14 | 57 | ## Template
|
| 58 | +
|
15 | 59 | The following fields are templated with [sprig](http://masterminds.github.io/sprig/):
|
16 | 60 |
|
17 |
| -* API |
18 |
| -* Request Body |
| 61 | +* API |
| 62 | +* Request Body |
| 63 | +* Request Header |
19 | 64 |
|
20 | 65 | ## TODO
|
21 |
| -* Reduce the size of context |
22 |
| -* Support customized context |
| 66 | +
|
| 67 | +* Reduce the size of context |
| 68 | +* Support customized context |
23 | 69 |
|
24 | 70 | ## Limit
|
25 |
| -* Only support to parse the response body when it's a map or array |
| 71 | +
|
| 72 | +* Only support to parse the response body when it's a map or array |
0 commit comments