sadabnepal / graphql-ts-mocha-test

GraphQL API Test framework using TypeScript supertest library and mocha framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL API Automation Test framework

This is boilerplate project to show how we can automate graphql api using supertest | axios | pactum header

Requirements:

NodeJs VSCode

Getting Started:

Clone Repository

1. git clone https://github.com/sadabnepal/graphql-ts-mocha-test.git
2. Navigate to graphql-ts-mocha-test

Install the dependencies

npm install

API Sources

https://demo.vendure.io/shop-api [GraphQl]
https://demo.vendure.io/ [web app]

Run tests and Generate Report

npm test  [run all tests]

Key Features:

- GraphQL API Testing
- Request and Response log to report
- Multi environment support using dotenv
- Type support for better code intellisense
- Supertest and Axios api test boilerplate codes

Folder structure:

├───.vscode
|    └───settings.json
├───samples
├───test
|    ├───env
|    ├───helper
|    ├───helper
|    ├───payload
|    ├───specs
|    └───types
├───.gitignore
├───package-lock.json
├───package.json
├───README.md
└───tsconfig.json

Sample Report:

image

About

GraphQL API Test framework using TypeScript supertest library and mocha framework


Languages

Language:TypeScript 92.2%Language:JavaScript 7.8%