https://github.com/bredah/demo-js-test-api
https://github.com/bredah/demo-js-test-api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/bredah/demo-js-test-api
- Owner: bredah
- Created: 2021-03-30T16:30:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T16:32:30.000Z (over 4 years ago)
- Last Synced: 2025-05-17T08:09:02.682Z (7 months ago)
- Language: JavaScript
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Demo - API Testing
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.
- [Prepare](#prepare)
- [Execution](#execution)
- [Execution of tests using mocha](#execution-of-tests-using-mocha)
- [Execution of tests using cucumber](#execution-of-tests-using-cucumber)
## Prepare
Install the project dependencies:
```sh
npm install
```
## Execution
### Execution of tests using mocha
- Windows
```sh
set API_URL=https://petstore.swagger.io
npm run test:mocha
```
- Linux & Mac
```sh
API_URL=https://petstore.swagger.io npm run test:mocha
```
Output: console and html report (./mochawesome-report/mochawesome.html)
### Execution of tests using cucumber
- Windows
```sh
set API_URL=https://petstore.swagger.io
npm run test:cucumber
```
- Liunux & Mac
```sh
API_URL=https://petstore.swagger.io npm run test:cucumber
```
Output: console and html report (./cucumber-report.html)