Skip to content

StavLobel/automation_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Professional Selenium Test Automation Framework

Enterprise-grade UI automation testing for web applications using Python, Selenium, and Pytest

Python Selenium Pytest GitHub Actions License Code Style Pre-commit


🎯 About This Project

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.

πŸ† What Makes This Project Professional

  • 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

🎯 Perfect For

  • 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

πŸš€ Key Demonstrations

  • 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

🎯 Project Overview

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.

✨ Key Features

  • 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

πŸ› οΈ Technology Stack

  • 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)

πŸ“ Architecture

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

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • pip package manager
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/StavLobel/automation_project.git
    cd automation_project
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure environment

    # Create .env file with test credentials
    echo "SAUCE_USERNAME=standard_user" > .env
    echo "SAUCE_PASSWORD=secret_sauce" >> .env
  4. Run tests

    # Execute all tests
    pytest tests/
    
    # Run with detailed reporting
    pytest tests/ --html=report.html --self-contained-html

πŸ§ͺ Test Coverage

Authentication Testing

  • βœ… Valid user login flows
  • βœ… Invalid credential handling
  • βœ… Account lockout scenarios
  • βœ… Special character input validation
  • βœ… Empty field validation

Shopping Cart Functionality

  • βœ… Add/remove single and multiple items
  • βœ… Cart badge count accuracy
  • βœ… Price calculation verification
  • βœ… Item persistence across sessions
  • βœ… Edge case handling (rapid actions, double operations)

Advanced Scenarios

  • βœ… Cross-browser compatibility
  • βœ… Responsive design testing
  • βœ… Performance under load
  • βœ… Error handling and recovery
  • βœ… Data persistence validation

πŸ”§ Development Workflow

Code Quality Standards

# Format code with Black
black .

# Install pre-commit hooks
pre-commit install

# Run all quality checks
pre-commit run --all-files

Test Execution Options

# 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

πŸ“Š CI/CD Pipeline

GitHub Actions Workflow

  • Trigger: Push to main branch and pull requests
  • Environment: Ubuntu latest with Python 3.x
  • Steps:
    1. Code checkout and dependency installation
    2. Code formatting validation (Black)
    3. Pre-commit hook execution
    4. Test execution with reporting
    5. Artifact generation and storage

Generated Artifacts

  • πŸ“„ JUnit XML Report - For CI/CD integration
  • πŸ“Š HTML Report - Human-readable test results
  • πŸ“‹ Test Logs - Detailed execution information

πŸ—οΈ Best Practices Implemented

Design Patterns

  • Page Object Model - Separation of test logic from page interactions
  • Factory Pattern - Dynamic test data generation
  • Fixture Pattern - Reusable test setup and teardown

Code Quality

  • Type Hints - Enhanced code readability and IDE support
  • Docstrings - Comprehensive documentation
  • Error Handling - Robust exception management
  • Logging - Detailed execution tracking

Test Management

  • Modular Structure - Organized by functionality
  • Data-Driven Testing - Parameterized test scenarios
  • Parallel Execution - Optimized test runtime
  • Environment Isolation - Secure credential management

πŸ“ˆ Performance & Scalability

Optimization Features

  • 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

Monitoring & Reporting

  • 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

🀝 Contributing

We welcome contributions! Please follow these guidelines:

  1. Fork the repository and create a feature branch
  2. Install development dependencies and pre-commit hooks
  3. Write tests for new functionality
  4. Follow code style guidelines (Black formatting)
  5. Update documentation as needed
  6. Submit a pull request with clear description

Development Setup

# Install development dependencies
pip install -r requirements.txt

# Set up pre-commit hooks
pre-commit install

# Run quality checks
pre-commit run --all-files

πŸ“š Resources & References


πŸ“„ License

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

About

Professional Selenium automation project for SauceDemo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages