On Mon, Nov 24, 2014 at 04:36:07PM -0800, 'Wolfgang Grieskamp' via Swagger wrote:
> There is a lot what could be done here, and a bunch of work exists
> usually attributed as "model-based testing".
Ah, thanks for pointing out the right buzzword :).
> However, just based on the swagger spec, I don't think you would get
> very far, as it doesn't allow to describe valid sequences of API
> calls. For interesting test cases, you would need to make at least
> 2-3 valid calls to establish a certain state on the server. There
> needs to be a way how to specify that sequences, because a test
> generator cannot easily guess them.
That's part of what --parameters is for in my suggested:
> >> $ swagger-test --parameters=test-parameters.json http://
> >>
petstore.swagger.wordnik.com/api/api-docs
I'd handle the rest of it by launching the test backend with a
predefined state. Obviously, this would still just test that the
responses matched the expected schema, not that they made sense
(e.g. that PUT calls succesfully updated the attribute in question),
so it's not really a great way to test your backend implementation.
It would just be an easy way to make sure your spec matches reality.
Cheers,
Trevor
--
This email may be signed or encrypted with GnuPG (
http://www.gnupg.org).
For more information, see
http://en.wikipedia.org/wiki/Pretty_Good_Privacy