Skip to content

ChethanN18/Playwright-Automation-Framework

Repository files navigation

Playwright Automation Framework

A scalable UI and API automation framework built with Playwright and TypeScript, following industry-standard design patterns for maintainability, reusability, and ease of execution.

Tech Stack

  • Playwright
  • TypeScript
  • Node.js
  • ExcelJS
  • CSV Parse
  • Winston Logger
  • Allure Reporting

Framework Highlights

  • Page Object Model (POM)
  • Shared BasePage for common UI actions
  • API layer with reusable ApiClient
  • Page Object Manager & API Manager
  • Custom Fixtures using Playwright base.extend()
  • Multi-environment support (qa, dev, uat)
  • External test data support (CSV & Excel)
  • Utility classes for random data, dates, logging, and API assertions
  • UI and API automation within the same framework
  • Parallel execution support
  • Allure and HTML reporting
  • API mocking using page.route()

Project Structure

api/
artifacts/
config/
fixtures/
pages/
test-data/
tests/
utils/

Run Tests

Install dependencies:

npm install

Execute by environment:

npm run test:qa
npm run test:dev
npm run test:uat

Environment Configuration

Create an environment file from .env.example.

Example:

BASE_URL=
API_URL=
USERNAME=
PASSWORD=

Reporting

Playwright HTML Report:

npx playwright show-report

Allure Report:

allure serve allure-results

Design Principles

  • Separation of UI and API layers
  • Reusable page objects and API modules
  • Centralized configuration
  • Minimal code duplication
  • Maintainable and scalable project structure
  • Framework-level abstraction while leveraging native Playwright capabilities

Future Enhancements

  • CI/CD integration with Jenkins
  • Authentication token management
  • Docker execution
  • Cross-browser pipeline execution
  • Cloud execution support

About

Scalable Playwright UI & API automation framework built with TypeScript.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors