Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Beliagal/qa-report-automation/llms.txt

Use this file to discover all available pages before exploring further.

The entire test session in Valoraclick is represented by the ReportData object defined in models.py. This page documents every field, its type, its default value, and its role in the generated PDF and CSV exports. Understanding this schema is essential for anyone extending the tool, writing automated tests, or manually inspecting or editing session backup files.

ReportData Class Overview

import datetime
from typing import List, Dict

class ReportData:
    metadata: Dict[str, str]
    pruebas: List[Dict]

    def __init__(self) -> None:
        self.reset_data()

    def reset_data(self) -> None: ...
ReportData carries two top-level attributes: metadata (a flat key/value dictionary of session-level information) and pruebas (an ordered list of test step dictionaries). Both are initialised by reset_data(), which is called in __init__() and again whenever the analyst triggers RESET TOTAL.

ReportData.metadataDict[str, str]

The metadata dictionary stores all session-level information that appears in the PDF header and the CSV preamble. Every value is a string. The keys are fixed — they are set by reset_data() and mapped to specific UI widgets in _setup_metadata_grid().
Aplicación:
string
Name of the application under test. Defaults to "Valoraclick". Mapped to the Aplicación entry widget in the UI. Appears in the PDF’s INFORMACIÓN GENERAL section and as the first row in the CSV.
Tester:
string
Full name of the QA analyst conducting the session. Empty string by default. Used to compose the CSV backup filename — spaces are replaced with underscores (e.g. "Ana García"backup_2025-07-15_143022_Ana_García.csv). Falls back to "SinNombre" in the filename if left empty.
Fecha:
string
Test date in DD/MM/YYYY format. Auto-set to today’s date each time reset_data() is called via datetime.datetime.now().strftime('%d/%m/%Y'). The Fecha entry widget uses a key-level validator (_validate_date_input) that restricts input to digits and forward slashes with a maximum of 10 characters. The full export pipeline additionally validates this value against ^\d{2}/\d{2}/\d{4}$ before generating the PDF.
Historia de Usuario:
string
User story identifier or short name (e.g. "HU-042"). Empty string by default. Displayed in the UI grid but not currently rendered in the PDF — it is preserved in the session JSON and exported in the CSV preamble.
Requisitos:
string
Requirements reference string (e.g. "REQ-101"). Empty string by default. Treated identically to Historia de Usuario in the export pipeline.
Versión:
string
Version label for the application under test (e.g. "2.7.0"). Empty string by default. Rendered in the PDF alongside the Fecha field in the two-column metadata grid.
dep
string
Dependencies relevant to this test session (e.g. "Auth Service v3"). Empty string by default. Note that the key is "dep" — not "Dependencias:" — because it is stored without the trailing colon used by the UI label. Mapped to self.ent_dep in the UI by _sync().
resumen
string
Free-text executive summary of the test session. Empty string by default. Mapped to the multi-line self.txt_resumen textbox. Rendered in the PDF’s INFORMACIÓN GENERAL section as a multi_cell spanning the full page width.

ReportData.pruebasList[Dict]

pruebas is an ordered list of test step dictionaries. Each element corresponds to one row added via the AÑADIR PASO button. Steps are appended in the order they were added and cannot be reordered through the UI. They appear in the PDF execution table in the same order. Each step dictionary has exactly five keys:
input
string
The action performed or user input applied during this step (e.g. "Enter valid credentials and click Login"). Mapped to the Acción entry widget. This field is required — _on_add() will not append a step if this value is empty after stripping whitespace.
esp
string
The expected result for this step (e.g. "Redirect to dashboard"). Mapped to the Esperado entry widget. May be empty.
obt
string
The actual result obtained during execution (e.g. "Redirect to dashboard"). Mapped to the Obtenido entry widget. May be empty.
estado
string
The pass/fail verdict for this step. Must be either "Pass" or "Fail", as constrained by the read-only ComboBox widget in the UI. The PDF renders Pass steps in green text and Fail steps in red text. obtener_color_estado() in logic.py maps this value to its RGB tuple counterpart.
img
string
Absolute path to a screenshot file attached to this step (e.g. "C:/TestEvidence/login_error.png"), or an empty string "" if no image was attached. Accepted file types are .png, .jpg, and .jpeg. The PDF generator checks os.path.exists(img) before embedding — if the file has been moved or deleted since the step was added, the image is silently skipped.

Session File Schema — sesion_testing.json

The session file is written by _save_session() and read by _load_session(). It lives in the same directory as the application executable or script. Its purpose is crash recovery and continuity across launches — it is not the canonical export format (that is the PDF and CSV).
sesion_testing.json
{
    "meta": {
        "Aplicación:": "Valoraclick",
        "Tester:": "Ana García",
        "Fecha:": "15/07/2025",
        "Historia de Usuario:": "HU-042",
        "Requisitos:": "REQ-101",
        "Versión:": "2.7.0",
        "dep": "Auth Service v3",
        "resumen": "Login flow tested under normal and error conditions."
    },
    "pruebas": [
        {
            "input": "Enter valid credentials and click Login",
            "esp": "Redirect to dashboard",
            "obt": "Redirect to dashboard",
            "estado": "Pass",
            "img": ""
        },
        {
            "input": "Enter invalid password",
            "esp": "Error message displayed",
            "obt": "Error message displayed",
            "estado": "Pass",
            "img": "C:/TestEvidence/login_error.png"
        }
    ]
}
The top-level key is "meta", not "metadata". This is a deliberate naming choice in _save_session() and _load_session(): the session JSON uses "meta" as a compact alias for the report_data.metadata dictionary. Code that reads or writes this file manually must use the key "meta" — using "metadata" will cause _load_session() to silently restore an empty metadata state.

Field mapping summary

JSON pathPython attributeUI widget
meta["Aplicación:"]report_data.metadata["Aplicación:"]Aplicación CTkEntry
meta["Tester:"]report_data.metadata["Tester:"]Tester CTkEntry
meta["Fecha:"]report_data.metadata["Fecha:"]Fecha CTkEntry (validated)
meta["Historia de Usuario:"]report_data.metadata["Historia de Usuario:"]Historia de Usuario CTkEntry
meta["Requisitos:"]report_data.metadata["Requisitos:"]Requisitos CTkEntry
meta["Versión:"]report_data.metadata["Versión:"]Versión CTkEntry
meta["dep"]report_data.metadata["dep"]Dependencias CTkEntry (self.ent_dep)
meta["resumen"]report_data.metadata["resumen"]Resumen Ejecutivo CTkTextbox (self.txt_resumen)
pruebas[n]["input"]report_data.pruebas[n]["input"]Acción CTkEntry
pruebas[n]["esp"]report_data.pruebas[n]["esp"]Esperado CTkEntry
pruebas[n]["obt"]report_data.pruebas[n]["obt"]Obtenido CTkEntry
pruebas[n]["estado"]report_data.pruebas[n]["estado"]Status CTkComboBox
pruebas[n]["img"]report_data.pruebas[n]["img"]Image path via _on_img()
The session file is encoded as UTF-8 without BOM (encoding="utf-8"). The CSV backup, in contrast, is encoded as UTF-8 with BOM (utf-8-sig) for Excel compatibility. Do not conflate the two files.

Build docs developers (and LLMs) love