Project with E2E/UI tests using WebDriverIO and API tests with SuperTest
-
Requirements to run:
- NodeJs
- Npm
- Docker (if you want to run the E2E/UI tests inside containers)
- Chrome browser (For E2E/UI tests)
-
Setup instructions
- Run
npm install
to install all the dependencies
- Run
-
Main API Tests stack:
- SuperTest
- Typescript
- Mocha
- Chai
-
API Tests Features:
- Parameterized Tests
- Json Schema validation with Joi
- Environment variables config with Dotenv
- HTML Report with Mochawesome
- Lint and Code Style with ESlint
- Git Hooks with Husky
-
Instructions to run API tests:
npm run test:api
- To generate a HTML report:
npm run test:api:generateReport
- The report is generated in the path test/api/report
-
Intructions to run Lint:
- To check code:
npm run lint
- To fix code:
npm run lint:fix
- To check code:
-
Other info:
- For API Tests, I followed the Gherkin scenarios specified in the documentation, but I prefered to use the simpler Mocha implementation for writing those scenarios, instead of using Cucumber. This is a cleaner way of writing the scenarios and one less layer to give maintenance;
-
Report:
-
Main UI/E2E Tests stack:
- WebdriverIO
- Typescript
- Mocha
- Chai
-
UI/E2E Tests Features:
-
Instructions to run UI/E2E tests:
npm run test:ui
- The HTML report is generated automatically in the path test/e2e/report
- If you want to execute the tests with Docker:
- run
npm run docker:up:grid
to bring up the selenium grid - then run:
npm run test:remoteGrid
- run
-
Intructions to run Lint:
- To check code:
npm run lint
- To fix code:
npm run lint:fix
- To check code:
-
Report: