A production-inspired Playwright automation framework built with TypeScript, demonstrating maintainable test architecture, UI automation, API validation, runtime contract validation, hybrid testing, visual regression, and CI/CD quality gates.
- β Page Object Model (POM)
- β API Client Layer
- β Custom Playwright Fixtures
- β Dependency Injection
- β Centralized Environment Configuration
- β UI Automation
- β API Validation
- β Runtime API Contract Validation with Zod
- β Hybrid UI β API Validation
- β Visual Regression Testing
- β Cross-browser & Parallel Execution
- β GitHub Actions CI/CD
- β Scheduled Cross-browser Regression
- β TypeScript Strict Mode
- β ESLint & Prettier
- β HTML Report, Allure & Trace Viewer
This repository focuses on engineering quality rather than simply browser automation. It demonstrates clean architecture, reusable components, dependency injection, service-layer design, runtime validation, CI/CD integration, and maintainable automation practices.
The framework intentionally keeps the test suite compact. The goal is to demonstrate engineering decisions and reusable patterns rather than maximize the number of test cases.
Environment Config
β
βΌ
Test Suites
β
βΌ
Playwright Fixtures
β
ββββββββββββββββ΄βββββββββββββββ
βΌ βΌ
Page Objects API Clients
β β
ββββββββββββββββ¬βββββββββββββββ
βΌ
Playwright Engine
β
ββββββββββββββββΌβββββββββββββββ
βΌ βΌ βΌ
Chromium Firefox WebKit
.
βββ .github/
β βββ workflows/
βββ src/
β βββ api/
β βββ config/
β βββ data/
β βββ fixtures/
β βββ pages/
β βββ utils/
βββ tests/
β βββ visual.spec.ts-snapshots/
βββ playwright.config.ts
βββ package.json
βββ README.md
| Area | Technology |
|---|---|
| Language | TypeScript |
| Framework | Playwright |
| API | Playwright Request API |
| Runtime Contracts | Zod |
| Pattern | Page Object Model |
| Architecture | API Clients + Custom Fixtures |
| Configuration | dotenv + Environment Config |
| Reporting | HTML Report + Allure |
| CI/CD | GitHub Actions |
| Code Quality | ESLint + Prettier |
Every push and pull request validates:
- TypeScript type checking
- ESLint
- Prettier
- Focused Chromium validation
- UI
- API
- Hybrid UI β API
- Visual regression
- HTML report generation
- Test artifact upload
Full Chromium, Firefox, and WebKit regression is available through manual workflow execution and scheduled CI runs.
Local quality workflow:
npm run lint
npm run format:check
npm run typecheck
npm testEnvironment-specific endpoints are centralized in the framework configuration rather than hardcoded across tests, page objects, and API clients.
Supported configuration includes:
BASE_URLUSERS_API_URLROOMS_API_URLROOMS_UI_URL
Public demo endpoints have local fallback values so the repository can be cloned and executed without mandatory secrets.
A local .env file can be used to override defaults when needed.
Backend communication is encapsulated in reusable API clients instead of being performed directly inside tests.
The API layer provides:
- centralized endpoint configuration
- HTTP status validation
- typed response models
- runtime response validation
- reusable API operations
- separation between test intent and transport logic
Runtime schema validation is implemented with Zod, allowing API payloads to be validated at execution time rather than relying only on TypeScript compile-time assertions.
The framework includes a hybrid scenario that validates application data across frontend and backend layers.
The test:
- Retrieves room data through the API client.
- Opens the corresponding UI.
- Reads rendered room information through the Page Object.
- Compares UI data with the backend response.
This demonstrates cross-layer validation while keeping API, UI, and test responsibilities separated.
Playwright screenshot assertions provide visual regression coverage.
Approved visual baselines are version-controlled for:
- Windows
- Linux
- Chromium
- Firefox
- WebKit
CI compares rendered output against approved Linux baselines rather than generating new baselines during validation.
Baseline updates are intentional changes and should be reviewed before being committed.
This portfolio framework intentionally uses public demo applications and APIs. Because these external systems are not controlled by the repository, failures are classified before being treated as product regressions.
- Product failure β deterministic assertion failure caused by incorrect application behavior.
- Infrastructure failure β DNS, TLS, timeout, service outage, or external dependency unavailability.
- Visual failure β approved baseline differs from the rendered UI.
- Flaky failure β a test produces inconsistent results without a deterministic product change.
- CI retries are enabled only in CI to reduce noise from transient infrastructure issues.
- Pull requests run a focused Chromium validation suite for fast feedback.
- Full Chromium, Firefox, and WebKit regression runs manually and on a scheduled basis.
- Screenshots, videos, traces, HTML reports, and test artifacts are retained for investigation.
- Visual baselines are version-controlled separately for Windows and Linux.
- External-service failures are investigated before assertions or visual baselines are changed.
A failing test should not be automatically classified as flaky.
Before changing or quarantining a test:
- Reproduce the failure.
- Review Playwright trace, screenshot, video, and network behavior.
- Determine whether the failure originated from the application, test code, or external infrastructure.
- Update the test only when the root cause is understood.
Retries are diagnostic protection against transient failures, not a substitute for fixing unstable tests.
- Page Objects isolate selectors and browser interactions from business assertions.
- API Clients encapsulate backend communication and response handling.
- Custom Fixtures provide reusable dependency injection for pages and API clients.
- Environment Configuration keeps endpoints outside implementation classes.
- Runtime Contracts validate external API payloads instead of relying only on TypeScript casts.
- Hybrid UI β API Testing validates business data across application layers.
- Visual Baselines are version-controlled and platform-specific.
- Parallel Execution uses isolated Playwright browser contexts.
- Focused PR Validation provides fast feedback while scheduled regression preserves broader cross-browser coverage.
Clone the repository and install dependencies:
git clone https://github.com/GitHubMaster07/playwright-typescript-quality-framework.git
cd playwright-typescript-quality-framework
npm install
npx playwright install --with-depsRun the complete test suite:
npm testAdditional commands:
npm run test:smoke
npm run test:ui
npm run lint
npm run format:check
npm run typecheck
npm run report:allureThe framework provides:
- Playwright HTML Report
- Allure Report
- Playwright Trace Viewer
- Screenshots on failure
- Video on failure
- CI test artifacts
These artifacts support root-cause investigation without requiring immediate local reproduction.
The CI pipeline separates fast feedback from broader regression coverage.
Runs quality gates followed by a focused Chromium validation suite covering:
- login workflow
- API validation
- hybrid UI β API validation
- visual regression
Runs the complete test suite across:
- Chromium
- Firefox
- WebKit
This keeps pull-request feedback focused while preserving regular cross-browser validation.
Potential future extensions:
- Expand runtime schema validation across additional APIs
- Authentication state management
- Test data builders
- Accessibility validation
- Performance testing
The framework intentionally avoids adding features solely to increase repository size; future additions should demonstrate a distinct Quality Engineering capability.
Current Version: v1.1.0
Stabilized portfolio release featuring centralized environment configuration, reusable API clients, Zod runtime contract validation, custom Playwright fixtures, hybrid UI β API validation, cross-platform visual regression, and scheduled cross-browser CI.
Sergei Volodin
Senior Quality Engineer / SDET
- LinkedIn: https://www.linkedin.com/in/serge-vol/
- GitHub Portfolio: https://github.com/GitHubMaster07/-Sergei-Volodin-_portfolio
β If you find this repository useful, consider starring it on GitHub.