I have an endpoint that can return status code 200 or 400 depending the time of day. How would I go about creating a test that can check for either of them?
pm.test('Check status code', () => {
pm.expect(pm.response.code).to.be.oneOf([200, 400])
})
That’s a quick example of a test that would check to see if the status code was either 200 or 400.
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