π 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.
Agent environment setup
For an AI coding agent, use the repository's setup-env skill to install frozen dependencies and Chromium without running tests. In Codex, invoke it with $setup-env.
βοΈ 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