Tests are incorrectly failing and passing!

I’ve just added a heap of assertions into my requests, and for the most part they are working great.

I had one I miswrote, so was correctly failing, so I corrected it, but it’s still failing.
So, just to check - I typed something into a passing test that should have caused it to fail, but it’s still passing.

Is there something I’m missing? Are the results getting stuck in a cache or something? I’ve tried closing/reopening etc, nothing seems to be bringing up the correct results.

The test:

tests [“price is correct”] = JSONdata.data[quoteNumber].price.total === 1100;

The reponse:

        "price": {
            "total": 1100

Any ideas?

Have you tried the same test written with the pm.test() syntax?

1 Like

I have seen some of our QE’s come to me with results like this and like @dannydainton suggested. Updating to the new syntax seems to have resolved many of those issues.

That worked! :smiley: Which is obviously awesome, but now I have the problem of updating 800 odd tests to the new syntax! Damn. Will only make the mistake once though, I suppose. Need to learn to not listen to out of date tutorials!

1 Like

Maybe that gives you a chance to assess the whole collection and trim the checks that might not be still giving you the value they once did?

I would also recommend looking at using the collection and folder level tests, to avoid any unnecessary replication of the same test within each individual request.