https://github.com/rajatt95/testautomationframework_yt_rajat_api_cypress_js
This project is a Test Automation Framework built using Cypress and Javascript for automated testing of REST APIs.
https://github.com/rajatt95/testautomationframework_yt_rajat_api_cypress_js
crud-operations custom-utilities cypress cypress-mochawesome-reporter github-actions javascript nodejs rest-api test-automation vscode
Last synced: over 1 year ago
JSON representation
This project is a Test Automation Framework built using Cypress and Javascript for automated testing of REST APIs.
- Host: GitHub
- URL: https://github.com/rajatt95/testautomationframework_yt_rajat_api_cypress_js
- Owner: rajatt95
- Created: 2024-02-10T18:37:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-27T14:10:27.000Z (over 1 year ago)
- Last Synced: 2025-03-24T04:35:16.927Z (over 1 year ago)
- Topics: crud-operations, custom-utilities, cypress, cypress-mochawesome-reporter, github-actions, javascript, nodejs, rest-api, test-automation, vscode
- Language: HTML
- Homepage: https://www.youtube.com/@rajatt95
- Size: 502 KB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
# 💻 Test Automation Framework | API
[](https://www.cypress.io/)
[](https://js.org/index.html)
[](https://code.visualstudio.com/)
[](https://www.npmjs.com/package/cypress-mochawesome-reporter)
[](https://github.com/features/actions)
## 📑 Table of Contents
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Getting Started](#getting-started)
- [Running Tests](#running-tests)
- [Project Structure](#project-structure)
- [Configuration](#configuration)
- [Continuous Integration](#continuous-integration)
- [Reporting](#reporting)
- [Other Projects](#other-projects)
- [Technical Documents](#technical-documents)
- [Contacts](#contacts)
## 📖 Introduction
This repository contains a Test Automation Framework built using Cypress and Javascript for automated testing of REST APIs.
## 🛠️ Prerequisites
- [](https://nodejs.org/) (v18.16.1 or higher recommended)
- [](https://www.npmjs.com/) (v9.5.1 or higher recommended)
## ▶️ Getting Started
1. Clone the repository:
```bash
git clone https://github.com/rajatt95/TestAutomationFramework_YT_Rajat_API_Cypress_JS.git
```
2. Navigate to the project directory:
```bash
cd TestAutomationFramework_YT_Rajat_API_Cypress_JS
```
3. Install dependencies:
```bash
npm install
```
## 🚀 Running Tests
```bash
npm run cy:tests
```
## 📁 Project Structure
The tests follow a modular and maintainable structure:
```
|-- .github
| |-- workflows
| |-- 01_api_tests.yml
| |-- 02_api_tests_select_env.yml
|-- cypress
| |-- e2e
| |-- tests-reqres
| |-- login.cy.js
| |-- register.cy.js
| |-- users.cy.js
| |-- fixtures
| |-- request-body
| |-- users
| |-- user_create.json
| |-- user_update_patch.json
| |-- user_update_put.json
| |-- schema
| |-- users
| |-- user_create.json
| |-- user_update_patch.json
| |-- user_update_put.json
| |-- reports
| |-- support
| |-- utils
| |-- EndpointUtils.js
| |-- RequestBodyUtils.js
| |-- RequestUtils.js
| |-- ResponseUtils.js
| |-- SchemaUtils.js
| |-- VerificationUtils.js
| |-- commands.js
| |-- e2e.js
|-- .gitignore
|-- cypress.config.js
|-- package.json
```
- `cypress/e2e`: Contains the actual test files. You can organize your tests into subdirectories as needed.
- `cypress/fixtures`: Contains external files (example: user create/update data) that can be used to mock data during tests.
- `cypress/reports`: Contains the report for tests (Logs are attached).
- `cypress/support`: Contains custom commands and global configuration.
- `cypress/support/utils`: Contains the Utilities that provides methods for asserting different conditions on web elements, handling requests and responses.
## ⚙️ Configuration
- Modify `cypress.config.json` for Cypress configuration settings.
- Customize `commands.js` and other files in `cypress/support` for reusable commands.
## 🔄 Continuous Integration
This project is configured for CI using Github Actions. Check the configurations in `.github/workflows/*.yml`.
- `01_api_tests.yml`: This workflow executes tests in pre-defined environment PROD.
- `02_api_tests_select_env.yml`: This workflow will first ask User to select the environment (DEV / Pre-PROD / PROD) for tests execution.
## 📊 Reporting
Mochawesome report (Logs are attached) is stored in the `cypress/reports` directory.
## 🔭 Other Projects
- [](https://github.com/stars/rajatt95/lists/programming-language-java) -
[](https://github.com/stars/rajatt95/lists/selenium-automation-frameworks)
[](https://github.com/stars/rajatt95/lists/appium-automation-frameworks)
[](https://github.com/stars/rajatt95/lists/restassured-automation-framework)
- [](https://github.com/stars/rajatt95/lists/programming-language-javascript) -
[](https://github.com/stars/rajatt95/lists/cypress-automation-frameworks)
[](https://github.com/stars/rajatt95/lists/playwright-automation-frameworks)
- [](https://github.com/stars/rajatt95/lists/programming-language-python) -
[](https://github.com/stars/rajatt95/lists/requests-automation-framework)
## 📄 Technical Documents
- [](https://drive.google.com/drive/folders/1tne9pZjgWvfrS0l9tVHs6k1jnQHpTLoA?usp=sharing)
- [](https://github.com/rajatt95/Documents)
## 📧 Contacts
- [](mailto:rajatvermaa95@gmail.com)
- [](https://github.com/rajatt95)
- [](https://rajatt95.github.io/)
- [](https://www.linkedin.com/in/rajatt95)
- [](https://topmate.io/rajatt95)
- [](https://t.me/rajatt95)
- [](https://www.instagram.com/rajattvermaa95/)
- [](https://www.youtube.com/@rajatt95)
- [](https://chat.whatsapp.com/LP20xMGvxnEL88GoB58bo1)
- [](https://whatsapp.com/channel/0029Va9XXMhJ93waOU5Xer3r)
Feel free to reach out if you have any questions, or suggestions, or just want to chat!
Thanks for visiting my GitHub profile! 😊