https://img.shields.io/coverallsCoverage/github/proskynete/node-api-skeleton
Table of contents
This project will allow you to have a starting point to create end-to-end tests using a very complete suite.
Technologies used and that are necessary prior to installation:
- Node JavaScript runtime (I recommend using nvm to manage multiple versions of node).
- TypeScript TypeScript compiler.
- Eslint TypeScript linter.
- Cypress End-to-End testing runner.
- Testing Library Testing utilities that encourage good testing practices.
- Cucumber Cucumber is a tool that supports Behaviour-Driven Development (BDD).
- Gherkin The syntax that Cucumber understands to run the tests.
- Cucumber JSON Formatter Convert Cucumber messages into a JSON document. (Please follow the instructions to install this in your computer)
- Multiple Cucumber Html Reporter Transform Cucumber JSON output to beautiful HTML report.
Scripts | Description |
---|---|
start:open | Will open the Cypress interface to run the tests. |
start | Will run the tests headless. |
start:report | It will create the report using the information of the tests already executed. |
lint | It will review the syntax of the tests (step_definitions folder). |
lint:fix | It will fix tests that can be fixed automatically. |
The following folder structure shows only the most important folders.
.
βββ cypress/
β βββ downloads/
β βββ e2e/
β β βββ features/ # Features folder.
β β β βββ {domain}/ # Domain folder.
β β β β βββ {feature}.feature # Feature 1 file.
β β β βββ {domain}/ # Domain folder.
β β β β βββ {feature}.feature # Feature 2 file.
β β βββ βββ step_definitions/ # Step definitions folder.
β β β βββ {domain}/ # Domain folder.
β β β β βββ {step_definition}.cy.ts # Step definition 1 file.
β β βββ βββ {domain}/ # Domain folder.
β β βββ {step_definition}.cy.ts # Step definition 2 file.
β βββ support/
β β βββ commands.js
β β βββ e2e.js
β βββ fixtures/
β βββ screenshots/ # Folder with the screenshots of the failed tests
β βββ support/
β βββ videos/ # Folder with the videos of the failed tests
βββ jsonlogs/ # This folder is used to store the JSON logs generated by the tests.
βββ reports/ # This folder is created by the start:report command.
βββ .cypress-cucumber-preprocessorrc.json # Configuration file for the cucumber preprocessor.
βββ cypress.config.js # Configuration file for the Cypress interface.
βββ generate/report/config.js # Configuration file for the report generator.
βββ ...
GPL-3.0 - Eduardo Esteban Γlvarez CastaΓ±eda