# anghelll/automationframeworkp architecture

> Architecture diagram of the GitHub repository anghelll/automationframeworkp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anghelll/automationframeworkp
- Repository: https://github.com/anghelll/automationframeworkp

## Overview

##### 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).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CI/CD & Deployment Layer
    subgraph "CI/CD & Deployment"
        CI_Workflow["GitHub Actions (CI Workflow)"]:::cicd
        Test_Workflow["GitHub Actions (Test Workflow)"]:::cicd
        DockerContainer["Docker Container"]:::cicd
    end

    %% Test Layer
    subgraph "Test Layer"
        TestRunner["Pytest Test Runner"]:::testLayer
        PytestIni["pytest.ini"]:::testLayer
        Conftest["conftest.py"]:::testLayer
        TestLogin["Test Case: Login"]:::testLayer
        TestGithub["Test Case: GitHub CLI"]:::testLayer
    end

    %% Page Objects Layer
    subgraph "Page Objects"
        LoginPage["Login Page"]:::pageObjects
        DashboardPage["Dashboard Page"]:::pageObjects
        GithubCLIPage["GitHub CLI Page"]:::pageObjects
    end

    %% Configuration Layer
    subgraph "Configuration"
        BrowserSetup["Browser Setup"]:::configuration
        Settings["Settings"]:::configuration
    end

    %% Utility Layer
    subgraph "Utilities"
        Helpers["Helpers"]:::utils
    end

    %% Reporting Layer
    subgraph "Reports"
        R1["Report HTML"]:::reports
        R2["Report Extra HTML"]:::reports
        R3["Test Reports"]:::reports
    end

    %% Environment Configuration (Standalone)
    Environment["Environment Config"]:::env

    %% Flow Connections
    CI_Workflow --> TestRunner
    Test_Workflow --> TestRunner
    DockerContainer --> TestRunner

    TestRunner --> TestLogin
    TestRunner --> TestGithub
    TestRunner --> PytestIni
    TestRunner --> Conftest

    TestLogin -->|"calls"| LoginPage
    TestLogin -->|"calls"| DashboardPage
    TestGithub -->|"calls"| GithubCLIPage

    BrowserSetup --> LoginPage
    BrowserSetup --> DashboardPage
    BrowserSetup --> GithubCLIPage

    Settings --> LoginPage
    Settings --> DashboardPage
    Settings --> GithubCLIPage

    Environment --> BrowserSetup
    Environment --> Settings

    Helpers --> TestRunner

    TestRunner --> R1
    TestRunner --> R2
    TestRunner --> R3

    %% Click Events
    click TestLogin "https://github.com/anghelll/automationframeworkp/blob/main/tests/test_login.py"
    click TestGithub "https://github.com/anghelll/automationframeworkp/blob/main/tests/test_github_cli.py"
    click PytestIni "https://github.com/anghelll/automationframeworkp/blob/main/pytest.ini"
    click Conftest "https://github.com/anghelll/automationframeworkp/blob/main/conftest.py"

    click LoginPage "https://github.com/anghelll/automationframeworkp/blob/main/pages/login_page.py"
    click DashboardPage "https://github.com/anghelll/automationframeworkp/blob/main/pages/dashboard_page.py"
    click GithubCLIPage "https://github.com/anghelll/automationframeworkp/blob/main/pages/github_cli_page.py"

    click BrowserSetup "https://github.com/anghelll/automationframeworkp/blob/main/config/browser_setup.py"
    click Settings "https://github.com/anghelll/automationframeworkp/blob/main/config/settings.py"

    click Helpers "https://github.com/anghelll/automationframeworkp/blob/main/utils/helpers.py"

    click R1 "https://github.com/anghelll/automationframeworkp/blob/main/reports/test_report.html"
    click R2 "https://github.com/anghelll/automationframeworkp/blob/main/reports/test_report_.html"
    click R3 "https://github.com/anghelll/automationframeworkp/blob/main/tests/reports/test_report.html"

    click CI_Workflow "https://github.com/anghelll/automationframeworkp/blob/main/.github/workflows/ci.yml"
    click Test_Workflow "https://github.com/anghelll/automationframeworkp/blob/main/.github/workflows/test.yml"
    click DockerContainer "https://github.com/anghelll/automationframeworkp/tree/main/Dockerfile"

    click Environment "https://github.com/anghelll/automationframeworkp/blob/main/.env"

    %% Style Classes
    classDef testLayer fill:#ffcccc,stroke:#660000,stroke-width:2px;
    classDef pageObjects fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef configuration fill:#ccccff,stroke:#000066,stroke-width:2px;
    classDef utils fill:#ffebcc,stroke:#cc6600,stroke-width:2px;
    classDef reports fill:#e0ccff,stroke:#660066,stroke-width:2px;
    classDef cicd fill:#d9d9d9,stroke:#333333,stroke-width:2px;
    classDef env fill:#ccffff,stroke:#006666,stroke-width:2px;
```
