# jeffmonteiroo/ti_qualidade architecture

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

- Interactive diagram: https://gitdiagram.com/jeffmonteiroo/ti_qualidade
- Repository: https://github.com/jeffmonteiroo/ti_qualidade

## Overview

##### Project Type and Purpose
- This repository is a QA exam that includes both theoretical answers (divided into various “questao” directories) and practical work focused on API test automation using Cypress.
- The core practical component (“desafio-pratico”) targets API automation testing with Cypress. This tells us that the key technical focus is on test automation, particularly for APIs, leveraging Cypress as the test runner.

##### Main Components
a. Theoretical QA Responses:
- Directories: questao-1-validacao-maquina-cartao, questao-2-ferramentas-automacao-testes, questao-3-ambientes-complexos, questao-4-integracao-continua.
- These are conceptually separate—they contain explanations and details on various QA or testing principles.
b. Practical Automation (desafio-pratico):
- Within this, the “automacao-api-cypress” folder is the heart of the test automation.
- Inside “automacao-api-cypress”, you have the following key sub-components:
- cypress.config.js: Central configuration file for Cypress.
- cypress/e2e: Contains the test spec files (e.g., auth-token.cy.js) that define end-to-end tests.
- cypress/fixtures: Holds static data (e.g., autentication.json) typically used to feed test data.
- cypress/support: Contains additional commands (commands.js) and initial setup files (e2e.js) that extend and configure the Cypress behavior.
- Additionally, package.json lists dependencies and scripts, defining the automation environment.

##### Relationships and Interactions
- The Cypress test runner (configured by cypress.config.js) initializes the testing framework.
- Test specs (inside cypress/e2e) execute test scenarios, importing fixtures for static data and using support commands to interact with the API’s endpoints.
- The separation into fixtures, commands, and spec files reflects a modular design, ensuring that test data, utility functions, and actual test logic are clearly delineated.

##### Important Architectural Patterns/Design Principles
- Modular structure: Separation into distinct folders (tests, fixtures, support, configuration) follows best practices in test automation.
- Clear abstraction layers: Low-level data management is performed via fixtures; support files handle complex or repetitive logic; and test files focus on API interactions.
- Reusability and maintainability: Custom commands (in support) can be reused across multiple tests, ensuring consistency and ease of updates.

##### Final Detailing for the Principal Software Engineer
- Every component is clearly labeled (with names like “cypress.config.js”, “e2e tests”, “Fixtures”, “Support Commands”, etc.).

## Diagram (Mermaid)

```mermaid
graph TD
    %% Theoretical QA Responses
    subgraph "Theoretical QA Responses"
        Q1["Questao 1: Validacao Maquina Cartao"]:::qa
        Q2["Questao 2: Ferramentas Automacao Testes"]:::qa
        Q3["Questao 3: Ambientes Complexos"]:::qa
        Q4["Questao 4: Integracao Continua"]:::qa
    end

    %% Practical Test Automation Section
    subgraph "Practical Test Automation"
        DPT["desafio-pratico"]:::practical
        Config["Cypress Test Runner (cypress.config.js)"]:::config
        Dep["Dependency Management (package.json)"]:::dep
        Test["E2E Test Specs (auth-token.cy.js)"]:::test
        Fixtures["Data Layer (autentication.json)"]:::fixture
        SupportCommands["Support Commands (commands.js)"]:::support
        SupportSetup["Support Setup (e2e.js)"]:::support
        External["External API Endpoint"]:::external
    end

    %% Relationships
    DPT -->|"contains"| Dep
    Dep -->|"configures"| Config
    Config -->|"triggers"| Test
    Test -->|"uses"| Fixtures
    Test -->|"invokes"| SupportCommands
    Test -->|"invokes"| SupportSetup
    Test -->|"calls"| External

    %% Click Events for Theoretical QA Responses
    click Q1 "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/questao-1-validacao-maquina-cartao/README.mb"
    click Q2 "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/questao-2-ferramentas-automacao-testes/README.mb"
    click Q3 "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/questao-3-ambientes-complexos/README.mb"
    click Q4 "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/questao-4-integracao-continua/README.mb"

    %% Click Events for Practical Test Automation
    click DPT "https://github.com/jeffmonteiroo/ti_qualidade/tree/main/desafio-pratico/"
    click Config "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/desafio-pratico/automacao-api-cypress/cypress.config.js"
    click Dep "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/desafio-pratico/automacao-api-cypress/package.json"
    click Test "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/desafio-pratico/automacao-api-cypress/cypress/e2e/auth-token.cy.js"
    click Fixtures "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/desafio-pratico/automacao-api-cypress/cypress/fixtures/autentication.json"
    click SupportCommands "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/desafio-pratico/automacao-api-cypress/cypress/support/commands.js"
    click SupportSetup "https://github.com/jeffmonteiroo/ti_qualidade/blob/main/desafio-pratico/automacao-api-cypress/cypress/support/e2e.js"

    %% Styles
    classDef qa fill:#f9d5e5,stroke:#333,stroke-width:2px;
    classDef practical fill:#d1e8ff,stroke:#333,stroke-width:2px;
    classDef config fill:#c1f0db,stroke:#333,stroke-width:2px;
    classDef test fill:#ffc4c4,stroke:#333,stroke-width:2px;
    classDef fixture fill:#fff2c2,stroke:#333,stroke-width:2px;
    classDef support fill:#d9e3f0,stroke:#333,stroke-width:2px;
    classDef dep fill:#f0e68c,stroke:#333,stroke-width:2px;
    classDef external fill:#ffe0e0,stroke:#f00,stroke-width:2px;
```
