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/
├── config/ # Environment and test configuration
├── models/ # Data models and interfaces
├── pages/ # Page Object Model classes
├── tests/ # Test specifications
├── utils/ # Utility functions and helpers
├── test-results/ # Test execution artifacts
└── playwright-report/ # HTML report output
- 🔄 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.tsAdd these scripts to your package.json:
{
"scripts": {
"test:dev": "ENV=dev npx playwright test",
"test:qa": "ENV=qa npx playwright test",
"test:stage": "ENV=stage npx playwright test",
"test:prod": "ENV=prod npx playwright test",
"test:headed": "npx playwright test --headed",
"test:report": "npx playwright show-report"
}
}# Run QA tests
npm run test:qa
# Run specific test by name
npm run test:qa -- -g "checkout"
# Run in headed mode
npm run test:qa -- --headed
# View HTML report
npm run test:reportnpx 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.zipimport { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests',
timeout: 30000,
retries: 2,
use: {
baseURL: currentEnv.baseURL,
screenshot: 'only-on-failure',
video: 'on',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { browserName: 'chromium' },
},
{
name: 'firefox',
use: { browserName: 'firefox' },
},
{
name: 'webkit',
use: { browserName: 'webkit' },
},
],
});- 🧪 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.
# Fork the repository
# Create your feature branch
git checkout -b feature/new-test-scenario
# Commit your changes
git commit -m "Add new test scenario for checkout flow"
# Push to the branch
git push origin feature/new-test-scenario
# Open a Pull RequestYou 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