I'm trying to develop an automated testing suite for a REST API. I've been told that Swagger would be the right tool to use to do this. The API is being developed using the Spring Framework.
I can't figure out how I would use Swagger to do this. From my understanding Swagger is used to create nice API documentation. I've looked at this Dreamfactory blog post and it looks like they've got some kind of in browser testing functionality, but I don't think its really a test suite.
I've also taken a look at ServiceStack( and cucumber) but since its another framework I don't think it would work.
This google group discussion didn't see to point anywhere in particular either.
So, does anyone know how to develop a RESTful API testbed using Swagger?
Thanks!
As the other answers have mentioned, Swagger provides a way to define and document your API endpoints, methods, responses, errors, and more. It does not do any sort of automated testing out of the box.
There are a few tools that can read a Swagger definition to created automated tests, though:
There's others as well, because Swagger provides a good common language for API developers there's some great tools that are written on top of it.
Another answer mentioned to check out the Commercial Tools page on swagger.io, which has some more hosted services (free and paid).
Full disclosure - I'm one of the co-founders of Assertible and would love to hear your feedback if you get a chance to use it.
Swagger will let you nicely document your API, and will help you do manual, live tests with swagger-ui in that you can easily fill in arguments and see the responses through a web ui. Try the Swagger demo as an example of what I am referring to. http://petstore.swagger.io/
I have not tried this, but this might be of interest for more automated testing against Swagger definitions. https://github.com/Maks3w/SwaggerAssertions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With