Enterprise-grade UI automation testing for web applications using Python, Selenium, and Pytest
This repository showcases a production-ready test automation framework designed for modern web application testing. Built with industry best practices and enterprise standards, it demonstrates professional software testing methodologies that are commonly used in high-performing development teams.
- Industry-Standard Architecture: Implements the Page Object Model (POM) design pattern for maintainable and scalable test code
- Comprehensive Test Coverage: Demonstrates thorough testing strategies including positive flows, negative scenarios, and edge cases
- Modern Development Practices: Integrates CI/CD pipelines, code quality tools, and automated reporting
- Production-Ready Features: Includes error handling, logging, environment management, and performance optimization
- Professional Documentation: Comprehensive setup guides, architecture diagrams, and best practice documentation
- QA Engineers looking to demonstrate advanced automation skills
- Test Automation Specialists showcasing enterprise-level frameworks
- Software Engineers learning professional testing methodologies
- Interview Preparation for automation-focused roles
- Team Lead Positions requiring framework design experience
- Test Framework Design: Modular, maintainable, and scalable architecture
- CI/CD Integration: Automated testing with GitHub Actions and comprehensive reporting
- Code Quality: Black formatting, pre-commit hooks, and linting standards
- Security Best Practices: Environment variable management and credential handling
- Performance Optimization: Parallel execution, smart waits, and resource management
A comprehensive test automation framework demonstrating industry best practices for web application testing. Built with modern Python tools and designed for scalability, maintainability, and reliability in professional testing environments.
- Page Object Model (POM) - Maintainable and reusable test structure
- Comprehensive Test Coverage - Login flows, shopping cart functionality, edge cases
- CI/CD Integration - Automated testing with GitHub Actions
- Professional Reporting - HTML and JUnit XML reports with detailed logs
- Code Quality - Black formatting, pre-commit hooks, and linting
- Environment Management - Secure credential handling with .env files
- Testing Framework: Pytest
- Web Automation: Selenium WebDriver
- Language: Python 3.x
- CI/CD: GitHub Actions
- Code Quality: Black, pre-commit hooks
- Reporting: pytest-html, JUnit XML
- Test Site: SauceDemo (industry-standard demo application)
src/
βββ pages/ # Page Object Model
βββ base_page.py # Base class with common functionality
βββ login_page.py # Login page interactions
βββ products_page.py # Product catalog interactions
βββ cart_page.py # Shopping cart interactions
tests/
βββ conftest.py # Global test configuration and fixtures
βββ 01-login/ # Login test suite
β βββ test_login.py # Authentication tests
βββ 02-cart/ # Shopping cart test suite
βββ conftest.py # Cart-specific fixtures
βββ test_cart_basic.py # Core cart functionality
βββ test_cart_edge.py # Edge case scenarios
βββ test_cart_persistence.py # State persistence tests
.github/workflows/ci.yml # Continuous Integration pipeline
requirements.txt # Python dependencies
.pre-commit-config.yaml # Code quality automation
- Python 3.8+
- pip package manager
- Git
-
Clone the repository
git clone https://github.com/StavLobel/automation_project.git cd automation_project -
Install dependencies
pip install -r requirements.txt
-
Configure environment
# Create .env file with test credentials echo "SAUCE_USERNAME=standard_user" > .env echo "SAUCE_PASSWORD=secret_sauce" >> .env
-
Run tests
# Execute all tests pytest tests/ # Run with detailed reporting pytest tests/ --html=report.html --self-contained-html
- β Valid user login flows
- β Invalid credential handling
- β Account lockout scenarios
- β Special character input validation
- β Empty field validation
- β Add/remove single and multiple items
- β Cart badge count accuracy
- β Price calculation verification
- β Item persistence across sessions
- β Edge case handling (rapid actions, double operations)
- β Cross-browser compatibility
- β Responsive design testing
- β Performance under load
- β Error handling and recovery
- β Data persistence validation
# Format code with Black
black .
# Install pre-commit hooks
pre-commit install
# Run all quality checks
pre-commit run --all-files# Run specific test suite
pytest tests/01-login/
# Run with verbose output
pytest -v tests/
# Generate comprehensive reports
pytest tests/ --junitxml=test-results.xml --html=test-report.html --self-contained-html- Trigger: Push to main branch and pull requests
- Environment: Ubuntu latest with Python 3.x
- Steps:
- Code checkout and dependency installation
- Code formatting validation (Black)
- Pre-commit hook execution
- Test execution with reporting
- Artifact generation and storage
- π JUnit XML Report - For CI/CD integration
- π HTML Report - Human-readable test results
- π Test Logs - Detailed execution information
- Page Object Model - Separation of test logic from page interactions
- Factory Pattern - Dynamic test data generation
- Fixture Pattern - Reusable test setup and teardown
- Type Hints - Enhanced code readability and IDE support
- Docstrings - Comprehensive documentation
- Error Handling - Robust exception management
- Logging - Detailed execution tracking
- Modular Structure - Organized by functionality
- Data-Driven Testing - Parameterized test scenarios
- Parallel Execution - Optimized test runtime
- Environment Isolation - Secure credential management
- Parallel Test Execution - Reduced total execution time
- Smart Waits - Optimized element interaction timing
- Resource Management - Efficient browser session handling
- Caching Strategies - Improved test data access
- Real-time Logging - Live test execution feedback
- Performance Metrics - Test execution time tracking
- Failure Analysis - Detailed error investigation tools
- Trend Analysis - Historical test result tracking
We welcome contributions! Please follow these guidelines:
- Fork the repository and create a feature branch
- Install development dependencies and pre-commit hooks
- Write tests for new functionality
- Follow code style guidelines (Black formatting)
- Update documentation as needed
- Submit a pull request with clear description
# Install development dependencies
pip install -r requirements.txt
# Set up pre-commit hooks
pre-commit install
# Run quality checks
pre-commit run --all-files- Selenium Documentation
- Pytest Framework
- Page Object Model Pattern
- GitHub Actions
- SauceDemo Test Site
This project is licensed under the MIT License - see the LICENSE file for details.
Built for professional test automation excellence π―
Demonstrating industry best practices in web application testing automation