As mentioned in other answers, Swagger provides a way to define and document your API endpoints, methods, answers, errors, and more. It does not perform any automatic tests out of the box.
However, there are several tools that can read the Swagger definition for automated tests created:
- Assertible is a tool into which you can import your Swagger specification to automatically create tests and assertions for each endpoint and method. You can then configure monitoring, post-deployment testing and alerts. (Read the blog Testing API with Swagger ). He has a free plan with the ability to upgrade for additional tests.
- Swagger-test is an NPM package if you are looking for something that can be integrated with your code. I personally have not used this, but it looks active and helpful.
- Dredd is another really cool open source tool that automates testing your Swagger specification on a real backend. It is also a CLI, and it works with the Blueprint API in addition to Swagger .
There are others as well, because Swagger provides a good common language for API developers, there are some great tools written on top of it.
Another answer mentions the Commercial Tools page on the swagger.io website, which has a few more hosted services (free and paid).
Full disclosure. I am one of the co-founders of Assertible and would like to hear your feedback if you have the opportunity to use them.
source share