api-test
Light weight automated JSON API testing framework. Run API tests from the terminal.
Organize your test cases in a JSON file
{
"testCases": {
"my_first_test_case": {
"path": "/books",
"query": {
"id": 1
},
"method": "GET"
}
...
},
"url": "my-api.com"
}
Call APIs
api-test run my_first_test_case # Run single test case
api-test run all # Run all test cases simultaneously
Add automated integration tests
Run the same tests in development
, staging
and production
environment automatically.
In JSON file:
{
"testCases": {
"my_first_test_case": {
"path": "/books",
"query": {
"id": 1
},
"method": "GET"
},
"expect": {
"body": {
"eq": {
"id": "1",
"author": "Robin Wieruch",
"title": "The Road to React"
},
"contains": {
"id": "1"
},
"hasKey": ["id", "author", "title"]
}
}
},
"url": "my-api.com"
}
Run automated test:
api-test test my_first_test_case
Result:
Compatible with CI Workflow
Integrate automated tests in CI workflow.