# rutbelcarlostc/prueba-automatica architecture

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

- Interactive diagram: https://gitdiagram.com/rutbelcarlostc/prueba-automatica
- Repository: https://github.com/rutbelcarlostc/prueba-automatica

## Overview

##### Project Type and Purpose
- This is a Java-based test-automation framework (Maven project) that exercises a web application’s invoice creation UI, downloads the resulting PDF, and performs visual assertions on the PDF using Applitools Eyes.

##### High-Level Components
- Test Runner (Maven Surefire)
- Test Layer (src/test/java)
- Page Object Layer (src/main/java/pages)
- Utility Layer (src/main/java/utils)
- Resource Store (chromedriver, test.properties, sample PDFs, ImageTester JAR)
- WebDriver (ChromeDriver)
- AUT (Application Under Test – the invoice web UI)
- PDF Handling (downloaded invoices + FileUtils)
- Visual Validation Service (Applitools Eyes)

##### Relationships & Data Flows
a. Maven Surefire invokes Test Classes (PDFTests, InvoiceFlowTests via BaseTests).
b. Test Classes call page objects (LoginPage → SignupPage → InvoiceGeneratorPage → InvoicePreviewPage).
c. Page objects use WebDriver (via ChromeDriver) to manipulate the AUT.
d. On invoice generation, the AUT returns a downloadable PDF.
e. FileUtils (utility layer) reads the PDF from disk.
f. EyesManager sets up Applitools SDK; test sends PDF snapshots or images to Applitools Eyes for visual validation.
g. Applitools Eyes returns pass/fail that the test runner captures.

##### Architectural Patterns
- Layered POM structure:
- Test layer depends on Page Object layer
- Page Object layer depends on WebDriver and AUT
- Utility layer is shared across pages/tests
- External-service integration: Applitools cloud service for visual testing
- Configuration abstraction via test.properties

##### Key Points
- Major directories as logical modules.
- Configuration flow: test.properties → BaseTests → EyesManager.
- Call out the ImageTester_3.7.1_Linux.jar if it’s used for converting PDF pages to images.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Test Runner Layer
    subgraph "Test Runner Layer"
        Surefire["Maven Surefire"]:::code
    end

    %% Test Layer
    subgraph "Test Layer"
        BaseTests["BaseTests"]:::code
        PDFTests["PDFTests"]:::code
    end

    %% Page Object Layer
    subgraph "Page Object Layer"
        LoginPage["LoginPage"]:::code
        SignupPage["SignupPage"]:::code
        InvoiceGeneratorPage["InvoiceGeneratorPage"]:::code
        InvoicePreviewPage["InvoicePreviewPage"]:::code
    end

    %% Utility Layer
    subgraph "Utility Layer"
        FileUtils["FileUtils"]:::code
    end

    %% Resource Store
    subgraph "Resource Store"
        Chromedriver["chromedriver"]:::resource
        TestProperties["test.properties"]:::resource
        ImageTester["ImageTester_3.7.1_Linux.jar"]:::resource
        SamplePDF["INV12345.pdf"]:::resource
    end

    %% WebDriver & AUT
    ChromeDriver["ChromeDriver (WebDriver)"]:::external
    AUT["Application Under Test (Web UI)"]:::external
    DownloadedPDF["Downloaded PDF"]:::resource
    ApplitoolsEyes["Applitools Eyes (Cloud Service)"]:::external

    %% Connections
    Surefire -->|"execute tests"| BaseTests
    Surefire -->|"execute tests"| PDFTests
    TestProperties -->|"load config"| BaseTests
    BaseTests -->|"initialize SDK"| EyesManager["EyesManager"]:::code
    PDFTests -->|"invoke| methods"| LoginPage
    LoginPage -->|"invoke methods"| SignupPage
    SignupPage -->|"invoke methods"| InvoiceGeneratorPage
    InvoiceGeneratorPage -->|"invoke methods"| InvoicePreviewPage
    InvoicePreviewPage -->|"trigger download"| AUT
    LoginPage -->|"use WebDriver"| ChromeDriver
    SignupPage -->|"use WebDriver"| ChromeDriver
    InvoiceGeneratorPage -->|"use WebDriver"| ChromeDriver
    InvoicePreviewPage -->|"use WebDriver"| ChromeDriver
    ChromeDriver -->|"HTTP/DOM operations"| AUT
    AUT -->|"download PDF"| DownloadedPDF
    DownloadedPDF -->|"read/parse"| FileUtils
    ImageTester -->|"convert PDF to images"| FileUtils
    FileUtils -->|"prepare images"| EyesManager
    EyesManager -->|"upload images"| ApplitoolsEyes
    ApplitoolsEyes -->|"validation results"| PDFTests

    %% Click Events
    click Surefire "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/pom.xml"
    click PDFTests "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/test/java/PDFTests.java"
    click BaseTests "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/test/java/base/BaseTests.java"
    click EyesManager "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/test/java/base/EyesManager.java"
    click LoginPage "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/main/java/pages/LoginPage.java"
    click SignupPage "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/main/java/pages/SignupPage.java"
    click InvoiceGeneratorPage "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/main/java/pages/InvoiceGeneratorPage.java"
    click InvoicePreviewPage "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/main/java/pages/InvoicePreviewPage.java"
    click FileUtils "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/src/main/java/utils/FileUtils.java"
    click Chromedriver "https://github.com/rutbelcarlostc/prueba-automatica/tree/main/resources/chromedriver"
    click TestProperties "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/resources/test.properties"
    click ImageTester "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/resources/ImageTester_3.7.1_Linux.jar"
    click SamplePDF "https://github.com/rutbelcarlostc/prueba-automatica/blob/main/resources/Invoice_PDFs/INV12345.pdf"

    %% Styles
    classDef code fill:#D6EAF8,stroke:#3498DB
    classDef external fill:#D5F5E3,stroke:#27AE60
    classDef resource fill:#FCF3CF,stroke:#F1C40F
```
