How anghelll/automationframeworkp works
Project Type & Purpose
• This is an automation framework for web application testing using Selenium and Pytest.
• The framework uses a Page Object Model (POM) to encapsulate web interactions, ensures cross-browser compatibility via configurations, and integrates seamlessly with CI/CD (GitHub Actions) and Docker for containerized execution.
Main Components
a. Test Runner & Test Cases:
• Pytest is being used as the test runner. Include components such as:
• Test Files (e.g., tests/test_login.py, tests/test_github_cli.py).
• Pytest’ configuration (pytest.ini, conftest.py for test fixtures and driver setups).
b. Page Objects:
• The Pages directory contains the POM files like dashboard_page.py, github_cli_page.py, and login_page.py. These encapsulate how the framework interacts with different web pages.
c. Configuration Settings:
• The config directory holds files (browser_setup.py and settings.py) for WebDriver configuration, browser initialization, and general settings (timeouts, URLs, etc.).
d. Utilities:
• The utils folder contains helper functions (helpers.py) that support logging, screenshot capture, and any additional common tasks.
e. Reports & Logging:
• The reports directory gathers output data such as HTML test reports. Additionally, there are reports inside the tests folder to show test-specific results.
f. CI/CD and Deployment:
• The .github folder contains GitHub Actions workflows for continuous integration.
• A Dockerfile is also provided, signifying containerization for consistent testing environments.
g. Environment Configuration:
• The .env file (although ignored at VCS level) is used to set environment variables that might affect browser or framework behavior.
• Test Execution Flow:
• How each test case calls the Page Object Model components to interact with the application.
• Page Object Interaction:
• Browser & WebDriver Setup:
• A “Configuration” component where the “browser_setup.py” and “settings.py” files reside. Show connections between the configuration and Page Objects as well as test fixtures (via conftest.py) that instantiate WebDriver instances.
• CI/CD Integration:
• Reporting:
• A Reporting component where the test outcomes (HTML reports in reports/ and tests/reports) are stored. Link the test runner to the reporting module.
• Containerization:
• Docker as an external container engine that encapsulates the framework environment for consistent execution.
Architectural Patterns & Design Principles
• Page Object Model (POM): Highlight the separation of page-specific methods into individual classes.
• Separation of Concerns: Clearly demarcate test logic, configuration, and utility functions.
• Extensibility & Modularity: Indicate how additional tests or page objects can be added without modifying core configuration logic.
• CI/CD Integration: The use of GitHub Actions for automated test runs, suggesting continuous integration practices.
• Parallel Test Execution: Mention the ability to run tests in parallel (as indicated by the -n auto flag in the README).