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
/*!
- Postman BDD v5.0.6 (April 8th 2018)
- https://bigstickcarpet.github.io/postman-bdd
- @author James Messinger (http://bigstickcarpet.com)
- @license MIT
*/
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
- Tags: external-library