✨ API Testing using Javascript, Supertest, Mocha, Chai, Mochawesome for HTML Report, & POM Design Pattern ✨
What will be used on this project
Item | Source |
---|---|
Editor | VS Code (https://code.visualstudio.com/download) |
Package Manager | NPM (https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) |
API Test Tools | Chai (https://www.npmjs.com/package/chai) |
Chai Json Schema (https://www.npmjs.com/package/chai-json-schema) | |
Supertest (https://www.npmjs.com/package/supertest) | |
Dotenv (https://www.npmjs.com/package/dotenv) | |
Test Reporter | Mochawesome (https://www.npmjs.com/package/mochawesome) |
Run on | Terminal or Command Prompt |
Install VS Code Editor and NPM.
To check whether you already installed NPM & Node.js
npm --version
node --version
👉 Clone this Repository through Terminal or Command Prompt
Open this Automation Project using VS Code Editor.
Change to Project directory on Terminal or Command Prompt
cd SupertestPOM
Install Chai
npm install chai
Install Chai-Json-Schema
npm install chai-json-schema
Install Supertest
npm install supertest
Install Dotenv
npm install dotenv --save
Install Mochawesome Reporter
npm install mochawesome
Change to Project directory on Terminal or Command Prompt
cd SupertestPOM
Run All Tests on Terminal
npm run test
Run Specific Test
npm run test test/get-apod.test.js
Run API Test with the Reporter
Note: Please wait until all test execution finished
All Test
npm run report
Test HTML Report
✅ available on /SupertestPOM/report/report.html