|
1 | | -# api-testing-axios-mocha-chai-javascript |
2 | | -This is sample REST API Automation framework designed using Axios, Mocha, Chai, and JavaScript |
| 1 | +--- |
| 2 | +# API Automation using Axios, Mocha, Chai and JavaScript Setup Guide |
| 3 | +--- |
| 4 | + |
| 5 | +## Getting started |
| 6 | + |
| 7 | +### Pre-requisites |
| 8 | +* Download and install Node.js |
| 9 | +* Download and install any Text Editor like Visual Code/Sublime/Brackets |
| 10 | + |
| 11 | +### Setup Visual Code |
| 12 | +* Install GitLens Extension from the Marketplace: `GitLens — Git supercharged by GitKraken` |
| 13 | +* Install vscode-icons from the Marketplace: `vscode-icons` |
| 14 | +* Go to Visual Code Preference > Setting and search `formatOnSave` and enable/ON it. |
| 15 | + |
| 16 | +### Setup Scripts |
| 17 | +* Clone the repository into a folder |
| 18 | +* Go to Project root directory and install Dependency: `npm install` |
| 19 | +* All the dependencies from package.json would be installed in node_modules folder. |
| 20 | + |
| 21 | +### How to write Test |
| 22 | +* Add new test under `api-tests` folder |
| 23 | +* Name the file as <testname>.js (e.g. get_request.js) |
| 24 | + |
| 25 | +### How to Run Test |
| 26 | +* Go to Project root directory and run command: `npm test` |
| 27 | +* If you want to run api tests then run command: `npx mocha --recursive api-tests/*.js --timeout 10000 --reporter mochawesome` |
| 28 | + |
| 29 | +### How to Update local npm packages |
| 30 | +* Go to Project root directory and run command: `npm update` |
| 31 | + |
| 32 | +### How to view HTML report |
| 33 | +* Go to Project root directory: `./mochawesome-report/mochawesome.html` |
| 34 | + |
| 35 | +### Sample Test Results |
| 36 | + |
| 37 | + |
| 38 | + |
0 commit comments