This project presents some ways to perform API tests: unit (mocha) and behavior (cucumber)
-
unit: presents a closer view of development in the form of creating unit tests.
-
behavior: presents the behavioral test, using a common language so that all members of the project can interpret, thus allowing everyone to add, modify and remove the tests created.
Install the project dependencies:
npm install
- Windows
set API_URL=https://petstore.swagger.io
npm run test:mocha
- Linux & Mac
API_URL=https://petstore.swagger.io npm run test:mocha
Output: console and html report (./mochawesome-report/mochawesome.html)
- Windows
set API_URL=https://petstore.swagger.io
npm run test:cucumber
- Liunux & Mac
API_URL=https://petstore.swagger.io npm run test:cucumber
Output: console and html report (./cucumber-report.html)