Skip to content

nirtal85/Playwright-Typescript-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

466 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Playwright Logo

Enterprise-Grade Playwright TypeScript Architecture

The Ultimate Boilerplate for Scalable, Robust, and Modern UI Automation

Twitter Follow YouTube Architecture by TestShift CI Status Nightly Build Tests Formatted with Biome

View Live Report β€’ Read The Docs β€’ Report Bug


πŸš€ About The Project

This repository serves as a Production-Ready Reference Architecture for building high-scale automated testing frameworks using Playwright and TypeScript.

It demonstrates advanced design patterns, seamless CI/CD integration, and strictly typed infrastructure that define modern Quality Engineering.

✨ Key Features

  • Modern Tooling: Built with Biome for lightning-fast linting and formatting (replacing ESLint/Prettier).
  • Strict TypeScript: Full type safety for robust and maintainable code.
  • Smart Reporting: Full integration with Allure Report, including history, trends, and environment data.
  • CI/CD Ready: Optimized GitHub Actions workflows with parallel execution and auto-merging of results.
  • Advanced Patterns: Implementation of Dynamic Base URLs, Auto Fixtures, and Data-Driven Testing (DDT).

πŸ“ƒ Articles written about this project

This project implements the concepts discussed in the following TestShift articles:


πŸ› οΈ Tech Stack

Tool Description & Why We Use It
Playwright The industry standard for reliable, flaky-free browser automation.
TypeScript For strict type safety and better developer experience (Intellisense).
Biome Next-gen toolchain for formatting and linting (faster than Prettier/ESLint).
Allure For beautiful, data-rich test reports.
Husky Git hooks to ensure code quality before commit.
Dotenv For secure environment variable management.
XLSX For Data-Driven Testing (DDT) using Excel files.

Pro Tip: For the best development experience, we recommend installing the Biome IntelliJ plugin.


βš™οΈ Setup Instructions

1. Clone

git clone https://github.com/nirtal85/playwright-typescript-example.git
cd playwright-typescript-example

2. Install Dependencies

We use pnpm for fast and efficient package management.

corepack enable
pnpm install

3. Install Browsers

playwright install --with-deps

4. Configuration

Create a .env file in the project root directory.

General Configuration

Parameter Description Example Value
DOMAIN Environment (DEV, PROD) "DEV"
BASE_URL Application URL "https://example.com"
LD_TOKEN LaunchDarkly API Token "api-xxx"

Database & Services

Parameter Description
DB_HOST MySQL Connection details
DB_USER MySQL Connection details
DB_PASSWORD MySQL Connection details
SFTP_HOST SFTP Connection details
SFTP_USER SFTP Connection details
VRT_APIURL Visual Regression Tracker details
VRT_APIKEY Visual Regression Tracker details

πŸƒβ€β™‚οΈ Execution

Run all tests:

playwright test

Run via UI Mode (Interactive):

playwright test --ui

πŸ“Š Viewing Test Results

We use Allure for reporting. To view results locally:

pnpm exec allure generate allure-results --output allure-report --open

πŸ‘‰ See a Live Example of the Report Here


Found this project useful? If this architecture helped you solve a problem or save time, consider supporting the work!

Buy Me A Coffee


Visit TestShift.com for more Architectural Insights

About

Enterprise-Grade Playwright TypeScript Architecture 🎭 | Production-Ready Boilerplate with Biome, Allure & CI/CD.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors