My question:
Hi All! Iām a QA working with Postman and learning how to write Tests and i have a query regarding IF statements (if this is the right solution for my problem)
Essentially i have a folder labelled āCertificatesā and have a couple of call within this folder, iām making one call for some certificate information, which is returned in JSON, however i have another call which can return the certificate itself in a PDF format.
The tests Iām running daily are scheduled at the folder level for these calls and Iām wanting to know if i can write a test which includes an IF Statement, for example my current test features this:
pm.test(āHeader to have Content Type āapplication/pdfā OR āapplication/jsonāā, function () {
pm.expect(pm.response.headers.get('Content-Type')).to.be.oneOf(["application/json","application/pdf"]) });
i want to know if i can then take this further and say IF this returns āapplication/jsonā then i want it to see if āExample ID 1ā, āExample ID 2ā is returned.
Is this something that is possible?