Hi there,
I’m really new to Postman and have what might be an obvious question!
What I’m trying to do is have an API spec file which has the specifications and the tests all in one - which Postman seems to be able to do - and then run the tests automatically - which may end up me doing something with newman.
In the tests, what I’d like to be able to do is have it try an end point without a particular value being completed, check it returns a 404, another parameter being null, check it’s a 404, try with one or all completed, check the response, etc. So say I have the endpoint ‘/comment?application_id={{application_id}}&account_id={{account_id}}&scope={{scope}}’, try it first with everything being empty, then with {{application_id}} having some content, then {{account_id}}, etc. {{scope}} is optional so would need to test that, too.
Now, if I understand it right I can use these variables and define them in my environment, right? But if I define them there won’t they always be filled out?
I can see that I can write tests in js which looks really neat as I’ll be able to tests response codes, values, etc. So I assume I can put the multiple tests mentioned above in there?
Thanks for any advice!
Andy