An open API service indexing awesome lists of open source software.

https://github.com/tooniez/supertest-cucumber-ts

📋 Develop API Integration tests with SuperTest and Cucumber BDD TS with reports deployed on Github pages!
https://github.com/tooniez/supertest-cucumber-ts

api-testing cucumber cucumber-html-reporter jest supertest typescript

Last synced: 4 months ago
JSON representation

📋 Develop API Integration tests with SuperTest and Cucumber BDD TS with reports deployed on Github pages!

Awesome Lists containing this project

README

        

# SuperTest Cucumber API Testing Boilerplate 🚀🔬

[![Test and Publish Cucumber Report](https://github.com/tooniez/supertest-cucumber-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/tooniez/supertest-cucumber-ts/actions/workflows/ci.yml)

A ready-to-use boilerplate for API testing using SuperTest and Cucumber with TypeScript.

## Features

- SuperTest for making HTTP requests and assertions
- Cucumber for behavior-driven development (BDD) testing
- TypeScript for type-safe code
- Jest as the test runner
- HTML report generation for test results

## Project Structure

- `features/`: Contains Cucumber feature files
- `features/support/`: Contains step definitions and support files for Cucumber
- `specs/`: Contains SuperTest specification files
- `report.js`: Script to generate HTML reports

## Configuration Files

- `jest.config.js`: Jest configuration
- `cucumber.js`: Cucumber configuration (if needed)
- `tsconfig.json`: TypeScript configuration

## Project Setup

🔧 Run the following command to install all the project dependencies:

```shell
npm install
```
## Running Tests

### Run All Tests

To run both SuperTest and Cucumber tests:

```shell
npm run test
```

### Run SuperTest POC Tests

To run the SuperTest proof-of-concept tests:

```shell
npm run test:supertest
```

### Run Cucumber E2E Tests

To execute the end-to-end tests using Cucumber:

```shell
npm run test:cucumber
```

### Generate HTML Report

After running the Cucumber tests, generate an HTML report:

```shell
npm run generate:report
```

## View Cucumber Report

You can view the latest Cucumber report on GitHub Pages:

[View Cucumber Report](https://tooniez.github.io/supertest-cucumber-ts/)

## License

📝 Copyright © 2023 [tooniez](https://github.com/tooniez).

This project is [MIT](https://github.com/tooniez/vuejs-typescript-cypress/blob/main/LICENSE) licensed.