Article directory
Overview
Official website: https://www.apifox.cn/
ApiFox integrates API documentation, API debugging, API Mock, and API automated testing functions.
Apifox = Postman + Swagger + Mock + JMeter
Create new interface
In an interface, ApiFox allows you to add the following parts:
- Interface name, group, status, responsible person, service, label, description
- Request method (GET, POST, PATCH, PUT, DELETE, HEAD, etc.)
- Request path (for example
/hello/world/{world_id}?offset=0&limit=25
) - Request parameters (Query and Path)
- Request body
- Request header
- Cookie
- Auth
- SSL settings, automatic redirection
- Response result (return result)
Request method
ApiFox supports GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, TRACE, CONNECT, COPY, LINK, UNLINK, PURGE, LOCK, UNLOCK, MKCOL, MOVE, PROPFIND, REPORT, VIEW methods.
Request path & request parameters
Fill in the path after ip:port
or in the request path . In the request path, you can add request parameters (Query Parameters) and path parameters (Path Parameters) . For example , the request parameters and path parameters will automatically appear in the request parameters section:ip:port/project_name
/hello/world/{world_id}?offset=0&limit=25
offset
limit
world_id
Request body
For each field in the request body, you can set its data type , Mock regular expression , and advanced settings (as shown below, you can set default values , enumerations , value ranges, etc., and you can set rules directly by editing the source code ):
Request header
Request header fields can be set for each interface
response body
The field settings of the response body are similar to the request body
Interface testing
For the backend, in addition to being an interface document, it is also an interface testing tool (see Postman).
Automatically generate appropriate test data
We can add Params, Body, Headers and other test data in the interface test just like using Postman, but its power lies in the fact that we can automatically generate interfaces based on the Mock regularity, default values, enumeration and other information set in the previous "Request Body" Test Data !
Save test case
Unlike Postman, which uses groups as the granularity, ApiFox saves test cases at the granularity of each specific interface:
Mock
When the back-end interface has not yet been written, the front-end needs to use a fake data interface to perform data rendering testing on the front-end page. ApiFox provides this Mock function and can automatically generate appropriate Mock data according to the rules set above :