# fimyh/automatisation-formation architecture

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

- Interactive diagram: https://gitdiagram.com/fimyh/automatisation-formation
- Repository: https://github.com/fimyh/automatisation-formation

## Overview

##### Project type and purpose
- Key clues: presence of Robot Framework test files (*.robot under resources/ and tests/), Python scripts (read_incident.py, test_selenium.py), a Jenkinsfile and docker-compose.yml, plus Chromedriver.exe.
- Purpose: run end-to-end tests (UI via Selenium, incident-based tests against ServiceNow and JIRA), generate reports (report.html, log.html, output.xml), and upload incident results back to JIRA.

##### File structure
Top-level artifacts:
- Jenkinsfile – defines CI/CD pipeline.
- docker-compose.yml – defines containers for tests or dependencies.
- requirements.txt & package.json – Python and Node/JS dependencies, suggesting some tooling or reporters rely on npm.
- chromedriver.exe – local Selenium WebDriver.
- incident.json – sample payload for incident-based tests.
- Python modules in libraries/ – custom keywords (JiraUpload.py, shadow.py).
- resources/ – Robot Framework keyword definitions and variables.
- test.robot, tests/*.robot – actual Robot Framework test suites.
- test_selenium.py – standalone Selenium test.

##### README
- README only contains a title (“ProjetAlten”), so we assume that most architectural insights must come from the structure itself.

##### Main components and interactions
a. CI/CD layer (Jenkins)
- Orchestrates the pipeline: checks out code, spins up containers via Docker Compose, installs dependencies, runs tests, collects artifacts, and optionally uploads results to JIRA.
b. Container/Environment setup (Docker Compose)
- Defines the test environment (e.g., a container for Python, optional mock servers, perhaps ServiceNow mocks).
- Ensures chromedriver and browsers are available.
c. Test Engine
- Robot Framework core that glues together:
– resources/ (keyword libraries and variable files)
– tests/*.robot and test.robot (test suites)
– custom Python libraries (libraries/JiraUpload.py for pushing to JIRA; shadow.py for any utilities)
- test_selenium.py runs Python‐only Selenium tests.
d. External Services
- ServiceNow (real or sandbox) – accessed via keywords in resources/servicenow_keywords.robot
- JIRA – accessed via keywords in resources/jira_keywords.robot and the JiraUpload.py library
e. Reporting & Artifacts
- Robot generates output.xml, log.html, report.html
- test_selenium.py may produce its own logs
- Jenkins archives these artifacts and can push statuses to JIRA

##### Architectural patterns & design principles
– Separation of concerns:
- CI/CD layer (Jenkinsfile) is isolated from test logic
- Environment definition (docker-compose.yml) decoupled from code
- Test code separated into reusable resource keyword files and test suites
– Extensibility: adding a new external system just requires a new resource keyword file and library
– Reusability: custom Python libraries under libraries/ are loaded by Robot to share functionality

– Label every component clearly

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "CI/CD Pipeline"
        CI_Jenkins["Jenkins CI/CD"]:::ci
        CI_Jenkinsfile["Jenkinsfile"]:::ci
        CI_War["jenkins.war"]:::ci
    end

    subgraph "Environment Setup"
        Env_Docker["docker-compose.yml"]:::env
        Env_PythonReq["requirements.txt"]:::env
        Env_NodePkg["package.json"]:::env
        Env_NodeLock["package-lock.json"]:::env
        Env_Chrome["chromedriver.exe"]:::env
    end

    subgraph "Test Execution"
        Exec_RobotCore["Robot Framework Core"]:::test
        Exec_TestSuite["test.robot"]:::test
        Exec_IncidentTest["tests/test_incident.robot"]:::test
        Exec_SNTest["tests/test_servicenow.robot"]:::test
        Exec_ResourcesVar["resources/variables.robot"]:::test
        Exec_ResourcesJira["resources/jira_keywords.robot"]:::test
        Exec_ResourcesSN["resources/servicenow_keywords.robot"]:::test
        Exec_SeleniumPy["test_selenium.py"]:::test
        Exec_IncidentPayload["incident.json"]:::test
        Exec_ReadInc["read_incident.py"]:::test
        Exec_ReadIncJira["read_incident_jira.py"]:::test
        subgraph "Custom Libraries"
            Lib_JiraUpload["libraries/JiraUpload.py"]:::lib
            Lib_Shadow["libraries/shadow.py"]:::lib
        end
    end

    subgraph "External Systems"
        Ext_ServiceNow["ServiceNow API"]:::external
        Ext_JIRA["JIRA API"]:::external
    end

    subgraph "Artifacts & Reporting"
        Art_Output["output.xml"]:::artifact
        Art_Log["log.html"]:::artifact
        Art_Report["report.html"]:::artifact
    end

    CI_Jenkins -->|"runs pipeline"| Env_Docker
    Env_Docker -->|"provisions containers"| Exec_RobotCore
    Env_PythonReq --> Exec_RobotCore
    Env_NodePkg --> Exec_RobotCore
    Env_NodeLock --> Exec_RobotCore
    Env_Chrome --> Exec_SeleniumPy

    Exec_RobotCore --> Exec_TestSuite
    Exec_RobotCore --> Exec_IncidentTest
    Exec_RobotCore --> Exec_SNTest
    Exec_RobotCore --> Exec_ResourcesVar
    Exec_RobotCore --> Exec_ResourcesJira
    Exec_RobotCore --> Exec_ResourcesSN
    Exec_RobotCore --> Lib_JiraUpload
    Exec_RobotCore --> Lib_Shadow

    Exec_SeleniumPy --> Ext_ServiceNow
    Exec_IncidentTest --> Ext_ServiceNow
    Exec_IncidentTest --> Ext_JIRA
    Exec_SNTest --> Ext_ServiceNow

    Exec_RobotCore -->|"generates"| Art_Output
    Exec_RobotCore --> Art_Log
    Exec_RobotCore --> Art_Report

    CI_Jenkins -->|"archives"| Art_Output
    CI_Jenkins --> Art_Log
    CI_Jenkins --> Art_Report
    CI_Jenkins -->|"uploads results"| Ext_JIRA

    click CI_Jenkinsfile "https://github.com/fimyh/automatisation-formation/tree/main/Jenkinsfile"
    click CI_War "https://github.com/fimyh/automatisation-formation/blob/main/jenkins.war"
    click Env_Docker "https://github.com/fimyh/automatisation-formation/blob/main/docker-compose.yml"
    click Env_PythonReq "https://github.com/fimyh/automatisation-formation/blob/main/requirements.txt"
    click Env_NodePkg "https://github.com/fimyh/automatisation-formation/blob/main/package.json"
    click Env_NodeLock "https://github.com/fimyh/automatisation-formation/blob/main/package-lock.json"
    click Env_Chrome "https://github.com/fimyh/automatisation-formation/blob/main/chromedriver.exe"
    click Exec_TestSuite "https://github.com/fimyh/automatisation-formation/blob/main/test.robot"
    click Exec_IncidentTest "https://github.com/fimyh/automatisation-formation/blob/main/tests/test_incident.robot"
    click Exec_SNTest "https://github.com/fimyh/automatisation-formation/blob/main/tests/test_servicenow.robot"
    click Exec_ResourcesVar "https://github.com/fimyh/automatisation-formation/blob/main/resources/variables.robot"
    click Exec_ResourcesJira "https://github.com/fimyh/automatisation-formation/blob/main/resources/jira_keywords.robot"
    click Exec_ResourcesSN "https://github.com/fimyh/automatisation-formation/blob/main/resources/servicenow_keywords.robot"
    click Exec_SeleniumPy "https://github.com/fimyh/automatisation-formation/blob/main/test_selenium.py"
    click Exec_IncidentPayload "https://github.com/fimyh/automatisation-formation/blob/main/incident.json"
    click Exec_ReadInc "https://github.com/fimyh/automatisation-formation/blob/main/read_incident.py"
    click Exec_ReadIncJira "https://github.com/fimyh/automatisation-formation/blob/main/read_incident_jira.py"
    click Lib_JiraUpload "https://github.com/fimyh/automatisation-formation/blob/main/libraries/JiraUpload.py"
    click Lib_Shadow "https://github.com/fimyh/automatisation-formation/blob/main/libraries/shadow.py"
    click Art_Output "https://github.com/fimyh/automatisation-formation/blob/main/output.xml"
    click Art_Log "https://github.com/fimyh/automatisation-formation/blob/main/log.html"
    click Art_Report "https://github.com/fimyh/automatisation-formation/blob/main/report.html"

    classDef ci fill:#CCE5FF,stroke:#3399FF,color:#000000
    classDef env fill:#F2F2F2,stroke:#999999,color:#000000
    classDef test fill:#DFFFD6,stroke:#33CC33,color:#000000
    classDef lib fill:#FFF2CC,stroke:#FFCC00,color:#000000
    classDef external fill:#FFD1D1,stroke:#FF6666,color:#000000
    classDef artifact fill:#E2E2FF,stroke:#6666FF,color:#000000
```
