radhakrishnanakireddy / cypress-schema-validation-demo

Automated API tests with Cypress and Ajv to validate response schemas. A basic demo to show you how to get automated schema validation going in your project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cypress-ajv-demo

Automated API tests with Cypress and Ajv to validate response schemas

About

This project uses Cypress to send automated API requests to the free publicly hosted cat facts API and runs basic assertions but also validates the response schema returned from the API. The purpose of this project is to demonstrate how to get schema validation going alongside your automated API tests.

This project validates a very basic schema, so to learn more on schema validation and how to validate complex JSON schemas you should checkout the Ajv docs here, and JSON schemas here.

Setup

Clone the repo down and get into the project's root directory, then:

npm install
npm run test

About

Automated API tests with Cypress and Ajv to validate response schemas. A basic demo to show you how to get automated schema validation going in your project.

License:MIT License


Languages

Language:JavaScript 100.0%