All Projects → JamesMessinger → Postman Bdd

JamesMessinger / Postman Bdd

Licence: mit
A BDD test framework for Postman and Newman

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Postman Bdd

Node Express Mongodb Jwt Rest Api Skeleton
This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API). Demo of frontend in VueJS here: https://github.com/davellanedam/vue-skeleton-mvp
Stars: ✭ 603 (+333.81%)
Mutual labels:  api, rest, postman, chai
chai
BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.
Stars: ✭ 7,842 (+5541.73%)
Mutual labels:  bdd, assertions, chai
Chakram
REST API test framework. BDD and exploits promises
Stars: ✭ 912 (+556.12%)
Mutual labels:  rest, bdd, chai
Zerocode
A community-developed, free, open source, microservices API automation and load testing framework built using JUnit core runners for Http REST, SOAP, Security, Database, Kafka and much more. Zerocode Open Source enables you to create, change, orchestrate and maintain your automated test cases declaratively with absolute ease.
Stars: ✭ 482 (+246.76%)
Mutual labels:  api, rest, assertions
Behapi
Behat extension for those who want to write acceptances tests for apis
Stars: ✭ 29 (-79.14%)
Mutual labels:  api, rest, bdd
Strapi Plugin Comments
A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
Stars: ✭ 138 (-0.72%)
Mutual labels:  api, rest
Narration
The Narration PHP Framework - Empowering everyone to build reliable and loosely coupled web apps.
Stars: ✭ 119 (-14.39%)
Mutual labels:  api, rest
Rocket Api
API敏捷开发框架,用于API接口功能的快速开发。不再定义Controller,Service,Dao,Mybatis,xml,Entity,VO等对象和方法.以springboot starter 形式集成使用
Stars: ✭ 122 (-12.23%)
Mutual labels:  api, postman
Poloniex Api Node
Poloniex API client for REST and WebSocket API
Stars: ✭ 138 (-0.72%)
Mutual labels:  api, rest
Golang Gin Realworld Example App
Exemplary real world application built with Golang + Gin
Stars: ✭ 1,780 (+1180.58%)
Mutual labels:  api, rest
Expect More
Curried Type Testing library, and Test Matchers for Jest
Stars: ✭ 124 (-10.79%)
Mutual labels:  bdd, assertions
Verify
BDD Assertions for PHPUnit and Codeception
Stars: ✭ 127 (-8.63%)
Mutual labels:  bdd, assertions
Rest Api Fuzz Testing
REST API Fuzz Testing (RAFT): Source code for self-hosted service developed for Azure, including the API, orchestration engine, and default set of security tools (including MSR's RESTler), that enables developers to embed security tooling into their CI/CD workflows
Stars: ✭ 119 (-14.39%)
Mutual labels:  api, rest
Gandi Live Dns
DynDNS Updater for Gandi LiveDNS REST API
Stars: ✭ 116 (-16.55%)
Mutual labels:  api, rest
Grappa
Behavior-oriented, expressive, human-friendly Python assertion library for the 21st century
Stars: ✭ 119 (-14.39%)
Mutual labels:  bdd, assertions
Wechatpay Postman Script
微信支付API v3的调试工具
Stars: ✭ 112 (-19.42%)
Mutual labels:  api, postman
Zoomhub
Share and view high-resolution images effortlessly
Stars: ✭ 122 (-12.23%)
Mutual labels:  api, rest
Httpexpect
End-to-end HTTP and REST API testing for Go.
Stars: ✭ 1,821 (+1210.07%)
Mutual labels:  rest, assertions
Jersey Jwt
Example of REST API with JWT authentication using Jersey, Jackson, Undertow, Weld, Hibernate and Arquillian.
Stars: ✭ 131 (-5.76%)
Mutual labels:  rest, postman
Subzero Starter Kit
Starter Kit and tooling for authoring GraphQL/REST API backends with subZero
Stars: ✭ 136 (-2.16%)
Mutual labels:  api, rest

Postman BDD

✨ 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.have
pm.test("response is ok", () => {
    pm.response.to.have.status(200);
});

// example using pm.expect()
pm.test("environment to be production", () => {
    pm.expect(pm.environment.get("env")).to.equal("production");
});

// example using response assertions
pm.test("response should be okay to process", () => {
    pm.response.to.not.be.error;
    pm.response.to.have.jsonBody("");
    pm.response.to.not.have.jsonBody("error");
});

// example using pm.response.to.be*
pm.test("response must be valid and have a body", () => {
     // assert that the status code is 200
     pm.response.to.be.ok; // info, success, redirection, clientError,  serverError, are other variants
     // assert that the response has a valid JSON body
     pm.response.to.be.withBody;
     pm.response.to.be.json; // this assertion also checks if a body  exists, so the above check is not needed
});

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:

Remove describe blocks

describe() blocks were optional in Postman-BDD, and they don't exist at all in Postman's new syntax. So just remove them.

Replace it blocks with pm.test

Postman-BDD used it blocks to define tests, such as:

it('should return the correct customer', () => {
  // assertions here
});

Postman now has pm.test blocks, which work the same way. For example:

pm.test('returns the correct customer', () => {
  // assertions here
});

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.

it('should return a 200 response', () => {
  response.should.have.status(200);
});

it('should set the Location header', () => {
  response.should.have.header('Location');
});

it('should return a JSON response', () => {
  response.should.be.json;
});

it('should return the correct customer', () => {
  response.body.should.have.property('id', 12345);
});

Postman now supports its own fluent assertion syntax, which is somewhat similar.

pm.test('returns a 200 response', () => {
  pm.response.to.have.status(200);
});

pm.test('sets the Location header', () => {
  pm.response.to.have.header("Location");
});

pm.test('returns a JSON response', () => {
  pm.response.to.be.json;
});

pm.test('returns the correct customer', () => {
  let jsonData = pm.response.json();
  pm.expect(jsonData.id).to.eql(12345);
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].