Skip to content

rajatt95/TestAutomationFramework_YT_Rajat_API_Playwright_JS

Repository files navigation


💻 Test Automation Framework | API

Playwright JavaScript

VS Code Playwright HTML Reporter GitHub Actions

📑 Table of Contents

📖 Introduction

This repository contains a Test Automation Framework built using Playwright 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_Playwright_JS.git
  2. Navigate to the project directory:

    cd TestAutomationFramework_YT_Rajat_API_Playwright_JS
  3. Install dependencies:

    npm install

🚀 Running Tests

npm run playwright:tests

📁 Project Structure

The tests follow a modular and maintainable structure:

|-- .github
|     |-- workflows
|          |-- 01_api_tests.yml
|          |-- 02_api_tests_select_env.yml
|-- test-data
|     |-- 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
|-- tests-reqres
|     |-- login.spec.js
|     |-- register.spec.js
|     |-- users.spec.js
|-- utils
|     |-- EndpointUtils.js
|     |-- RequestBodyUtils.js
|     |-- RequestUtils.js
|     |-- ResponseUtils.js
|     |-- SchemaUtils.js
|     |-- TokenUtils.js
|     |-- VerificationUtils.js
|-- .gitignore
|-- package.json
|-- playwright.config.js
  • playwright-report: Contains the HTML report for tests (Logs are attached).
  • test-data: Contains external files (example: user create/update data) that can be used to mock data during tests.
  • tests-reqres: Contains the actual test files. You can organize your tests into subdirectories as needed.
  • utils: Contains the Utilities that provides methods for asserting different conditions on web elements, handling requests and responses.

⚙️ Configuration

  • Modify playwright.config.js for playwright configuration settings such as
    • baseURL
    • testDir
    • reporter

🔄 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

Playwright HTML report (Logs are attached) is stored in the playwright-report 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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published