Api test framework for test-api
Api(Restful api) is always the interface between backend and frontend.
Main Reasons for API Testing:
- Ensure Functionality and Reliability:
- Verifies that the API meets its functional requirements and performs as intended.
- Identifies and addresses bugs, errors, or inconsistencies that could affect the API's reliability and availability.
- Validate Data Integrity:
- Checks the accuracy, consistency, and completeness of data exchanged through the API.
- Ensures that data is not corrupted or manipulated during transmission and processing.
- Test Performance and Scalability:
- Evaluates the API's performance under various load conditions and scenarios.
- Identifies bottlenecks and optimizes the API to handle increased usage and maintain acceptable response times and throughput.
When in development, at the minimum cost to identify Design vs. Implementation Differences automatically.
#定义API接口 URL
API_URL = "http://47.115.214.0:5555"
#定义测试用例
TEST_CASES = [
{
"method": "GET",
"url": "/hello",
"params": "",
"expected_response": {
"code": 200,
"body": {
"Hello":"ERROR"
}
}
}
]
- Each test file only has 1 API_URL(Fixed name) and multipul TEST_CASES. (TEST_CASES can rename).
- Method: support GET, POST now.
- Check code and body consistency.
- Should easy to test, can be test in any folder with the same file structure.
- Dockfile is necessary.
github:
https://github.com/KingsVolvo/api-test-framework.git
PS: “dosubot bot ” can be used in personal project
image registry address
Aliyun:
registry.cn-hangzhou.aliyuncs.com/kinghuang/api-test-framework:1158
AWS:
477069922492.dkr.ecr.cn-northwest-1.amazonaws.com.cn/api-test-framework
JFrog:
(waiting for permission)
-
docker build -t api-test-img .
-
docker run api-test-img
-
sh get_testapi_result.sh