In this project I demonstrate how to use Supertest and Jest for Api test automation.
This project includes:
- Framworks:
- Supertest
- Jest
- Features:
- Helper´s, Clients´s
- ES6 style class-based approach
- Code formatter (ESlint, Prettier)
- Report with Allure
- node >= 10.18.x - how to install Node
- yarn >= 1.21.x - how to install Yarn
Install dependencies:
$ yarn install
For this tests i use a local api which can be found here: Simple jwt local api
$ yarn init:tests
Run the command below to generate the test report:
$ allure generate
To view the report in the browser, run the command:
$ allure serve
To lint and format the code, run:
$ yarn code:format
The environment variables of other configurations are loaded on EnvironmentVariables.js , to change the base url edit the address in config.json.