Marco AdΓ‘n Vera Zboralski
Senior QA Automation Engineer
This project demonstrates a scalable UI automation framework built with Playwright and TypeScript.
It follows real-world best practices such as Page Object Model (POM), multi-environment configuration, and reusable components to ensure maintainability and reliability.
This project follows a scalable and maintainable automation architecture:
- β Page Object Model (POM)
- β Separation of concerns (tests, pages, models, utils)
- β Dynamic DOM handling to avoid fragile locators
- β Multi-environment support (dev, qa, stage, prod)
- β Reusable utility classes
project-root/
βββ .github/ # GitHub workflows, PR templates, CODEOWNERS
βββ data/ # Test data files
β
βββ src/
β βββ api/
β β βββ clients/
β β β βββ jsonplaceholder/ # API client classes
β β βββ fixtures/ # API fixtures
β β βββ models/
β β β βββ jsonplaceholder/ # API data models/interfaces
β β βββ payloads/
β β β βββ jsonplaceholder/ # API request payload builders
β β βββ utils/ # API-specific utilities
β β βββ base.api.ts # Base API functionality
β β
β βββ config/
β β βββ saucedemo/ # Environment/configuration files
β β
β βββ fixtures/
β β βββ saucedemo/ # Playwright UI fixtures
β β
β βββ models/ # Shared UI/domain models
β β
β βββ pages/
β β βββ saucedemo/ # Page Object Model classes
β β
β βββ utils/ # Shared utilities and helpers
β
βββ tests/
β βββ api/
β β βββ jsonplaceholder/ # API test specs
β βββ ui/
β βββ saucedemo/ # UI test specs
β
βββ test-results/ # Test execution artifacts
βββ playwright-report/ # Playwright HTML reports
βββ allure-results/ # Allure raw results
βββ allure-report/ # Allure generated reports
β
βββ .gitignore
βββ .prettierrc
βββ package.json
βββ package-lock.json
βββ playwright.config.ts
βββ README.md
- π End-to-End flows (login, checkout)
- π² Dynamic product selection using randomization
- β Validation across UI layers
- π BDD-style comments (Given / When / Then)
- π Multi-environment execution
- π² Randomized test execution
- π Product validation across pages
- π οΈ Utilities for random data, waits, and calculations
- π¬ Playwright features:
- Video recording
- Trace viewer
- Screenshots on failure
# Clone the repository
git clone <repository-url>
# Navigate to project directory
cd playwright-automation-framework
# Install dependencies
npm install
# Install Playwright browsers
npx playwright install# Run all tests
npx playwright test
# Run a specific test file
npx playwright test tests/saucedemo/login-page.spec.ts
# Run tests by name
npx playwright test -g "login"
# Run in headed mode (visible browser)
npx playwright test --headed
# Run with specific number of workers
npx playwright test --workers=4# Run in debug mode
npx playwright test --debug
# Run with verbose output
npx playwright test --reporter=listThis framework supports multiple environments using the ENV variable.
Available environments:
dev(default)qastageprod
# Set environment and run all tests
set ENV=qa && npx playwright test
# Set environment and run specific test name
set ENV=qa && npx playwright test -g "checkout"
# Set environment and run specific file
set ENV=qa && npx playwright test tests/saucedemo/login-page.spec.ts# Set environment and run tests
$env:ENV="qa"; npx playwright test
# Run specific test
$env:ENV="stage"; npx playwright test -g "checkout"# Run all tests in QA environment
ENV=qa npx playwright test
# Run specific test in staging
ENV=stage npx playwright test -g "checkout"
# Run specific file in production
ENV=prod npx playwright test tests/saucedemo/checkout.spec.tsCommon scripts are defined in package.json.
Examples:
npm run test
npm run test:dev
npm run test:qa
npm run test:stage
npm run test:prod
npm run test:headed
npm run report:playwrightEnvironment-specific scripts use
cross-envto support Windows, macOS, Linux, and CI/CD environments.
npx playwright show-reporttest-results/
βββ videos/ # .webm video recordings
βββ traces/ # Playwright trace files
βββ screenshots/ # Failure screenshots
# Open trace viewer
npx playwright show-trace test-results/traces/trace.zip- π§ͺ Demonstrate automation framework design
- π» Practice Playwright + TypeScript
- π Showcase testing best practices
- π Serve as a portfolio project
Contributions are welcome! This project is intended to grow with additional real-world test scenarios.
You can:
- π§ͺ Add new test flows
- π¨ Improve existing tests
- β Enhance validations
- π‘ Suggest improvements
- π― Uses dynamic locators to avoid fragile selectors
- ποΈ Focus on maintainability and scalability
- π Designed to simulate real-world automation scenarios
- π Follows testing best practices and design patterns
This project is open source and available under the MIT License.
Marco AdΓ‘n Vera Zboralski π LinkedIn