Skip to content

MJ-Sarabando/e2e-testing-playwright

Repository files navigation

E2E Testing with Playwright & TypeScript

Playwright Tests TypeScript Playwright CI/CD License

A comprehensive end-to-end testing suite built with Playwright and TypeScript, demonstrating modern web application testing practices with automated CI/CD integration.

Developed by: Maria JoΓ£o Sarabando | GitHub


🎯 Project Overview

This project showcases a professional-grade E2E testing framework that demonstrates:

  • Modern Testing Architecture with Page Object Model
  • Cross-Browser Compatibility testing across Chrome, Firefox, Safari
  • Mobile Testing for iOS Safari and Android Chrome
  • CI/CD Integration with GitHub Actions
  • Performance & Accessibility testing capabilities

πŸš€ Key Features

πŸ”§ Technical Stack

  • Framework: Playwright v1.40.0
  • Language: TypeScript 5.0+
  • Testing Pattern: Page Object Model
  • CI/CD: GitHub Actions
  • Code Quality: ESLint + Prettier
  • Containerization: Docker support

🌐 Cross-Browser Testing

  • βœ… Desktop: Chrome, Firefox, Safari
  • βœ… Mobile: iOS Safari, Android Chrome
  • βœ… Parallel Execution for optimal performance
  • βœ… Headless & Headed modes supported

πŸ§ͺ Test Coverage

  • Authentication Flows - Login/logout, validation
  • Form Testing - Field validation, error handling
  • Search Functionality - Filters, sorting, suggestions
  • Performance Testing - Load times, memory usage
  • Accessibility Testing - ARIA compliance, keyboard navigation

πŸ“Š Test Results

βœ… 15 tests executed across 5 browsers
βœ… 100% pass rate
⚑ 8.3s total execution time
πŸš€ Parallel execution with 10 workers

Browser Performance Metrics:

  • WebKit (Safari): 1.2s - 2.0s ⚑
  • Mobile Browsers: 1.2s - 1.6s πŸ“±
  • Desktop Chrome: 2.1s - 4.3s πŸ–₯️
  • Firefox: 2.1s - 2.8s 🦊

πŸ› οΈ Installation & Setup

Prerequisites

  • Node.js (v18+)
  • npm or yarn
  • Git

Quick Start

# Clone the repository
git clone https://github.com/MJ-Sarabando/e2e-testing-playwright.git
cd e2e-testing-playwright

# Install dependencies
npm install

# Install Playwright browsers
npx playwright install --with-deps

# Run tests
npm test

Development Commands

# Run tests with UI mode
npm run test:ui

# Run tests in headed mode (see browser)
npm run test:headed

# Debug specific test
npm run test:debug

# Generate test reports
npm run test:report

# Code quality checks
npm run lint
npm run format

πŸ“ Project Architecture

e2e-testing-playwright/
β”œβ”€β”€ πŸ“ .github/workflows/     # CI/CD pipeline configuration
β”œβ”€β”€ πŸ“ tests/
β”‚   β”œβ”€β”€ πŸ“ auth/             # Authentication test suites
β”‚   β”œβ”€β”€ πŸ“ forms/            # Form validation tests
β”‚   β”œβ”€β”€ πŸ“ search/           # Search functionality tests
β”‚   β”œβ”€β”€ πŸ“ performance/      # Performance benchmarks
β”‚   β”œβ”€β”€ πŸ“ accessibility/    # A11y compliance tests
β”‚   β”œβ”€β”€ πŸ“ pages/           # Page Object Models
β”‚   └── πŸ“ utils/           # Test utilities & helpers
β”œβ”€β”€ πŸ“„ playwright.config.ts  # Playwright configuration
β”œβ”€β”€ πŸ“„ docker-compose.yml   # Container orchestration
β”œβ”€β”€ πŸ“„ Makefile             # Development shortcuts
└── πŸ“„ package.json         # Dependencies & scripts

πŸ§ͺ Test Categories

πŸ” Authentication Testing

βœ… Valid login credentials
❌ Invalid login attempts
πŸ” Empty field validation
⌨️ Keyboard navigation
πŸ”„ Error message handling

πŸ“ Form Validation

βœ… Successful form submission
πŸ“§ Email format validation
πŸ“ Character limit checks
🌐 Special character handling
🧹 Form state management

πŸ” Search Functionality

πŸ” Basic search operations
🚫 Empty query handling
πŸ“­ No results scenarios
🏷️ Category filtering
πŸ“Š Results sorting
πŸ’‘ Autocomplete suggestions

🐳 Docker Support

# Build and run with Docker
docker-compose up playwright-tests

# UI mode in container
docker-compose up playwright-ui

# View reports
docker-compose up playwright-report

πŸ”„ CI/CD Pipeline

The GitHub Actions workflow includes:

πŸš€ Automated Testing

  • Cross-browser test execution
  • Mobile device testing
  • Performance benchmarking
  • Accessibility validation

πŸ“ˆ Quality Assurance

  • Code linting & formatting
  • TypeScript compilation
  • Test coverage reports
  • Security vulnerability scanning

πŸ“Š Reporting & Artifacts

  • HTML test reports
  • Screenshot & video capture
  • Test trace recordings
  • GitHub Pages deployment

πŸ“ˆ Performance Insights

Metric Value Status
Total Tests 15 βœ…
Execution Time 8.3s ⚑
Parallel Workers 10 πŸš€
Browser Coverage 5 🌐
Success Rate 100% 🎯

🎯 Best Practices Demonstrated

βœ… Code Quality

  • TypeScript strict mode configuration
  • ESLint & Prettier integration
  • Conventional commit messages
  • Comprehensive documentation

βœ… Testing Excellence

  • Page Object Model implementation
  • Data-driven test scenarios
  • Cross-browser compatibility
  • Mobile-first approach

βœ… DevOps Integration

  • GitHub Actions CI/CD
  • Docker containerization
  • Automated reporting
  • Environment configuration

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-test)
  3. Commit changes (git commit -m 'feat: add amazing test')
  4. Push to branch (git push origin feature/amazing-test)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘©β€πŸ’» About the Developer

Maria JoΓ£o Sarabando


πŸ† Project Highlights

This project demonstrates proficiency in:

  • βœ… Modern Test Automation with Playwright
  • βœ… TypeScript Development best practices
  • βœ… CI/CD Pipeline implementation
  • βœ… Cross-Platform Testing expertise
  • βœ… Performance Optimization techniques
  • βœ… Professional Documentation standards

Built with ❀️ and β˜• by Maria JoΓ£o Sarabando

πŸ”— Connect on LinkedIn | πŸ‘€ View More Projects

⭐ Star this repository if you found it helpful! ⭐

About

End-to-end testing suite with Playwright and TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published