Skip to content

TrishaChetani/RESTFULAPITEST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

APITest

API test : httpbin API (https://httpbin.org)

  • Check the basic functionality of API.

Tech stacks

Setup

Dev Setup nodejs and yarn

  • install node
brew update
brew install node
  • install yarn
  • install mocha chai and supertest-as-promised Use yarn to install mocha chai and supertest-as-promised globally with:
yarn global add protractor

This will install two command line tools, mocha chai and supertest-as-promised. Try running mocha --version to make sure it's working. The Chai is a helper tool to for assertion of API response

Running test specs

yarn test

Folder structure

  • Tests - The tests will call functions from the API and Payload areas of the framework and be responsible for asserting responses.
  • API - HTTP requests are grouped based on the resource you are calling so if there are two resources called if the request changes it requires a single change to propagate through the framework.
  • Payloads - Payloads that are required for requests and responses are stored in this area. The idea is similar to the API area in that one class is responsible for one payload that may be called multiple times. Again, this means if the payload changes it requires a single change to propagate through the framework.

Releases

No releases published

Packages

No packages published