PostmanBDD library no longer working in newer versions POSTMAN

Since Postman has updated to version 11 > a imported postmanbdd library that was being used in all our tests seems to have stopped working so tests are not running locally in Postman.

This library is postman-bdd/OLD_README.md at master · JamesMessinger/postman-bdd · GitHub

/*!

I know it’s old and out of date and is no longer really needed but now it no longer works is causing us to have to refactor over 200 collections. I was just wondering if there was a way of getting this working again or not? It does work in an older version of Postman pre version 9 I think.

When running the tests locally we get an error in the console that looks like this:

sample of the kind of test assertion methods it uses:

eval(pm.environment.get("postmanBDD"));

describe("Body Assertions", () => {
        
        it("should return an array with length equal to '" + expectedPersonsCount + "'", () => {
          expect(response.body).to.be.an('array').to.have.lengthOf(expectedPersonsCount);
        });
    });;

The test successfully runs after removing the imported postmanbdd library, describe, it and expect and changing them to the standard built in new style of postman test syntax i.e. pm.expect, pm.test, pm.response.json().

  • Platform Details:
    Version11.12.0

UI version

11.12.0-ui-240903-1253

Desktop platform version

11.12.0

Architecture

x64

OS platform

win32 10.0.19045

It looks like that library is using deprecated Postman methods that are no longer supported.

The last couple of versions of the Postman client has been throwing up deprecation warnings for the methods that needed to be updated.

The functions still worked, but it now looks like the latest version has finally removed the functionality.

Someone would need to refactor that library to use the new methods.

As its no longer maintained, that doesn’t sound like its going to happen.

It’s also not really needed, as Postman uses the ChaiJS BDD styles.

Appreciate that you have 200 collections to update, but I don’t think you will have any other option but to do that.

1 Like

Thanks @michaelderekjones I’m not seeing a quick out of this either. Thought it was worth a try to see if anyone else is having to go through this and had any quick win suggestions.

Find and Replace is our best friend along with auto save it seems. Along with a few manual deletes.