Example
I have some generic tests stored against a collection folder… but would it be possible to somehow ignore those tests for a specific request?
e.g. my generic tests contain:
pm.test("Response status is 200", function() { pm.response.to.have.status(200); if (responseCode.code !== 200) return;
But I want to add tests that will return other response codes.
Thanks
Jon
Hey @jon.robinson ,
Welcome to the community
There was a question asked a couple of weeks ago around skipping tests if they don’t meet a certain criteria - Is this something that you’re looking for?
I have a test set in a collection to check whether the status of the response is one of a list:
pm.test('Check status code', () => {
pm.expect(pm.response.code).to.be.oneOf([200, 201, 202, 203, 204, 205, 206, 207, 208, 226])
})
In the Pre-request script of two of my requests, I have a line to skip the test that is set up for this collection (as I know the response of these two particular tests is going to be different but that’s ok for these as individual requests).
pm.test.skip(‘Check st…
Hi @danny-dainton … yes this is exactly what i’m after (i think). Thanks
Awesome
Take a look through the examples and try some of the things out - If you get stuck or need some extra information, give me a shout.