Skip to content

This project is a Test Automation Framework built using Cypress and Javascript for automated testing of REST APIs.

Notifications You must be signed in to change notification settings

rajatt95/TestAutomationFramework_YT_Rajat_API_Cypress_JS

Repository files navigation


💻 Test Automation Framework | API

Cypress JavaScript

VS Code Mochawesome Reports GitHub Actions

📑 Table of Contents

📖 Introduction

This repository contains a Test Automation Framework built using Cypress and Javascript for automated testing of REST APIs.

🛠️ Prerequisites

  • Node.js (v18.16.1 or higher recommended)
  • npm (v9.5.1 or higher recommended)

▶️ Getting Started

  1. Clone the repository:

    git clone https://github.com/rajatt95/TestAutomationFramework_YT_Rajat_API_Cypress_JS.git
  2. Navigate to the project directory:

    cd TestAutomationFramework_YT_Rajat_API_Cypress_JS
  3. Install dependencies:

    npm install

🚀 Running Tests

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
|           |-- login
|                |-- login-successful.json
|                |-- login-unsuccessful.json
|           |-- register
|                |-- register-successful.json
|                |-- register-unsuccessful.json
|           |-- users
|                |-- user_create.json
|                |-- user_update_patch.json
|                |-- user_update_put.json
|     |-- reports
|     |-- support
|          |-- utils
|                |-- EndpointUtils.js
|                |-- RequestBodyUtils.js
|                |-- RequestUtils.js
|                |-- ResponseUtils.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

  • Java - Selenium Appium Rest Assured

  • JavaScript - Cypress Playwright

  • Python - Requests

📄 Technical Documents

  • Google Drive
  • GitHub Repository

📧 Contacts

  • Email
  • GitHub Profile
  • GitHub Page
  • LinkedIn
  • Topmate
  • Telegram
  • Instagram
  • YouTube
  • WhatsApp Community
  • WhatsApp Channel

Feel free to reach out if you have any questions, or suggestions, or just want to chat!

Thanks for visiting my GitHub profile! 😊

rajatt95

Releases

No releases published

Packages

No packages published