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 QA tool automatically persists the full state of your test session to a local JSON file every time a test step is successfully committed. This means that if the application closes unexpectedly — due to a power cut, a system crash, or an accidental window close — you will not lose any steps that had already been added. When you relaunch the tool, it detects the saved file and restores your entire session: metadata, dependencies, executive summary, and all test steps, exactly as you left them.

The Session File

The session is stored in a file named sesion_testing.json. It is created and maintained by _save_session() in gui.py and read back by _load_session() on startup. The file is opened with encoding="utf-8" and written with indent=4 for human readability.

File Location

Run modeFile location
Compiled .exeSame directory as the executable
Source (python main.py)Project root directory (alongside gui.py, models.py, etc.)
The path is held in self.session_file = "sesion_testing.json" — a relative path, so it resolves to the current working directory at runtime.

Session File Structure

The JSON file contains two top-level keys: "meta" for the ReportData.metadata dictionary and "pruebas" for the list of step dictionaries. Below is a representative example:
{
    "meta": {
        "Aplicación:": "Valoraclick",
        "Tester:": "Ana García",
        "Fecha:": "15/07/2025",
        "Historia de Usuario:": "HU-042",
        "Requisitos:": "REQ-101, REQ-102",
        "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": ""
        }
    ]
}
The "meta" keys match those used in ReportData.metadata exactly — including the trailing colon on field names such as "Aplicación:" — so they map back into the entry widgets without any transformation. "dep" and "resumen" are stored as plain keys without a colon, handled separately in both _sync() and _load_session().

How Auto-Save Works

Every successful call to _on_add() — which occurs whenever AÑADIR PASO is clicked with a non-empty action field — triggers _save_session() immediately after the step is appended:
# gui.py — _on_add()
def _on_add(self):
    action = self.ent_in.get().strip()
    if not action:
        return
    step = {
        "input": action,
        "esp":   self.ent_es.get(),
        "obt":   self.ent_ob.get(),
        "estado": self.cmb_st.get(),
        "img":   self.current_img
    }
    self.report_data.pruebas.append(step)
    self._update_log()
    self._save_session()   # ← auto-save happens here
    self._clear_step()
Inside _save_session(), _sync() is called first to flush the current values of all metadata widgets into ReportData.metadata before serialising:
# gui.py — _save_session()
def _save_session(self):
    try:
        self._sync()
        with open(self.session_file, "w", encoding="utf-8") as f:
            json.dump(
                {"meta": self.report_data.metadata, "pruebas": self.report_data.pruebas},
                f, indent=4
            )
    except Exception:
        pass
Any exception during the save is silently suppressed so that a disk-write failure never interrupts the UI workflow.

How Session Restore Works

_load_session() is called at the end of __init__(), after the UI has been fully constructed. It checks for the session file, reads it, and repopulates every widget:
# gui.py — _load_session()
def _load_session(self):
    if not os.path.exists(self.session_file):
        return
    try:
        with open(self.session_file, "r", encoding="utf-8") as f:
            d = json.load(f)
        self.report_data.pruebas = d.get("pruebas", [])
        m = d.get("meta", {})
        for k, v in self.entries.items():
            if k in m:
                v.delete(0, "end")
                v.insert(0, m[k])
        self.ent_dep.insert(0, m.get("dep", ""))
        self.txt_resumen.insert("1.0", m.get("resumen", ""))
        self._update_log()
    except Exception:
        pass
After restore, _update_log() is called so the real-time preview panel immediately reflects all the previously saved steps with their green/red colour-coding. No user action is required — the session appears as if the application had never been closed.

Starting a Fresh Session

To discard the current session and begin a new test cycle, click RESET TOTAL in the top bar. The tool presents a confirmation dialog before taking any action. If you confirm, it:
  1. Calls ReportData.reset_data() to clear metadata back to defaults and empty pruebas.
  2. Deletes sesion_testing.json from disk using os.remove().
  3. Clears all entry widgets and the executive summary textbox.
  4. Resets the Fecha field to today’s date.
  5. Calls _update_log() to clear the preview panel.
# gui.py — _on_reset()
def _on_reset(self):
    if messagebox.askyesno("Borrar", "¿Deseas limpiar todo el informe?"):
        self.report_data.reset_data()
        if os.path.exists(self.session_file):
            try:
                os.remove(self.session_file)
            except:
                pass
        for e in self.entries.values():
            e.delete(0, "end")
        self.entries["Aplicación:"].insert(0, "")
        self.entries["Fecha:"].insert(0, datetime.datetime.now().strftime('%d/%m/%Y'))
        self.ent_dep.delete(0, "end")
        self.txt_resumen.delete("1.0", "end")
        self._update_log()
The session file sesion_testing.json is listed in the project’s .gitignore and will not be committed to version control. This is intentional — the file may contain sensitive test data, tester names, requirement IDs, and screenshot paths that should not be part of the source repository. Back up the file manually if you need to archive a session before running RESET TOTAL.
When running the compiled .exe, sesion_testing.json is created in the same folder as the executable. When running from source with python main.py, it is created in the project root directory — the folder that contains gui.py, models.py, and logic.py. Ensure the user account running the application has write permission to that directory.

Build docs developers (and LLMs) love