✨ Postman now has it's own BDD test syntax ✨
Postman-BDD is no longer necessary, because Postman now has its own BDD and fluent syntax built-in!
I recommend that you start using Postman's new test syntax instead of Postman-BDD. However, if you want to continue using Postman-BDD, then you can find the original ReadMe here.
Docs
Example
// example using pm.response.to.havepm; // example using pm.expect()pm; // example using response assertionspm; // example using pm.response.to.be*pm;
Migration Guide
Postman's new BDD and fluent syntax are a bit different from Postman-BDD. Here are the changes you need to make to migrate your tests:
describe
blocks
Remove describe()
blocks were optional in Postman-BDD, and they don't exist at all in Postman's new syntax. So just remove them.
it
blocks with pm.test
Replace Postman-BDD used it
blocks to define tests, such as:
;
Postman now has pm.test
blocks, which work the same way. For example:
pm;
Move hooks to folder/collection scripts
Postman-BDD allowed you to define common assertions or setup/teardown logic in hooks, such as before()
, after()
, beforeEach()
and afterEach()
. This is no longer necessary because Postman now allows you to define test scripts for folders and collections.
Different assertion syntax
Postman-BDD used the Chai.js and Chai-HTTP assertion libraries, which let you write assertions using an intuitive, fluent, English-like syntax.
; ; ; ;
Postman now supports its own fluent assertion syntax, which is somewhat similar.
pm; pm; pm; pm;