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.

Every time you export a PDF report, Valoraclick QA Tool automatically creates a structured CSV backup of the same session data and writes it to a Google Drive folder — no extra clicks, no separate export step. The backup runs synchronously as part of _on_export() in gui.py, immediately after the PDF file is written to disk. The success dialog you see at the end reflects both outcomes in a single message.

How the backup works

The backup is handled by CSVService.export() in services.py. The method follows a precise resolution chain to find the correct Google Drive destination before writing the file.

Windows shortcut resolution

The tool does not hardcode a direct folder path. Instead, it resolves a Windows shortcut (.lnk) to discover the target backup directory at runtime. This allows the underlying Drive folder to be reorganised without changing any application code — only the shortcut target needs to be updated. The resolution steps are:
  1. Look for the shortcut at the primary path G:\Mi unidad\Informes.lnk.
  2. Resolve the target using win32com.client.Dispatch("WScript.Shell").CreateShortCut(path).Targetpath. This returns the real folder the shortcut points to.
  3. Write the CSV to that target directory if the path was resolved successfully.
  4. Fall back to G:\Mi unidad directly if the shortcut file does not exist or the resolution raises an exception.
  5. Create the directory with os.makedirs(..., exist_ok=True) if neither path already exists on disk.
def _resolve_shortcut(self, path):
    try:
        if os.path.exists(path):
            shell = win32com.client.Dispatch("WScript.Shell")
            shortcut = shell.CreateShortCut(path)
            return shortcut.Targetpath
    except Exception:
        return None
    return None

CSV filename format

Every backup file gets a unique timestamped name so that multiple exports on the same day never overwrite each other:
backup_YYYY-MM-DD_HHMMSS_TesterName.csv
Spaces in the tester’s name are replaced with underscores. For example, a backup created on 15 July 2025 at 14:32:07 by tester Ana García would be saved as:
backup_2025-07-15_143207_Ana_García.csv

CSV file structure

The backup file is written with utf-8-sig encoding (UTF-8 with BOM) so it opens correctly in Microsoft Excel without encoding issues. It contains two logical blocks separated by an empty row:
Campo,Valor
Aplicación:,Valoraclick
Tester:,Ana García
Fecha:,15/07/2025
Historia de Usuario:,HU-042
Requisitos:,RF-07
Versión:,2.1.0
dep,Auth module
resumen,Validación del flujo de login con credenciales correctas e incorrectas.

Acción,Esperado,Obtenido,Estado,Ruta Imagen
Click login button,Redirect to dashboard,Redirect to dashboard,Pass,
Enter wrong password,Error message shown,Error message shown,Pass,/path/to/screenshot.png
Submit empty form,Validation errors displayed,Validation errors displayed,Pass,
Block 1 — Metadata: A two-column table with the header row Campo,Valor, followed by one row per metadata field in the order they are stored in ReportData.metadata. The keys are written exactly as stored: most fields carry a trailing colon (e.g. Aplicación:, Tester:, Fecha:), while the dependencies and executive summary fields are stored without one (dep, resumen). Block 2 — Test steps: Preceded by the column header Acción,Esperado,Obtenido,Estado,Ruta Imagen, each row corresponds to one test step. The Ruta Imagen column contains the absolute file path of the attached screenshot, or an empty string if no image was attached to that step.

Setup requirements

The following conditions must be met for the CSV backup to reach Google Drive successfully:
  1. Google Drive for Desktop must be installed and actively syncing on the machine running the QA Tool. By default, Google Drive for Desktop mounts as G:\Mi unidad on Windows.
  2. A shortcut named Informes.lnk must exist at G:\Mi unidad\Informes.lnk. This shortcut must point to the specific subfolder within your Drive where backups should be stored (for example G:\Mi unidad\QA\Backups).
  3. The pywin32 library must be installed in the Python environment. The shortcut resolution depends on win32com.client, which is provided by this package.
To create the required shortcut, open Windows Explorer and navigate to G:\Mi unidad. Right-click in an empty area of the folder, choose New → Shortcut, and enter the path to your desired backup subfolder (e.g. G:\Mi unidad\QA\Informes de Testing) as the shortcut target. Name the shortcut exactly Informes — Windows will add the .lnk extension automatically.

Behaviour when Drive is not available

If Google Drive is not installed, the drive letter G: is not mounted, or the shortcut resolution fails for any reason, the CSV backup is silently skipped. The PDF is still generated and saved successfully. The success dialog will display Backup en Drive: No disponible rather than Ok. No error is thrown and no data is lost — you can export the PDF again once Drive is configured to obtain a backup.
This feature requires Windows and the pywin32 package. The win32com.client module used for .lnk resolution does not exist on macOS or Linux. On non-Windows systems the shortcut resolution will always fail and the backup status will always show No disponible, even if the G:\ path somehow exists in the environment.

PDF Export

Learn how the PDF report is structured, how color-coded Pass/Fail rows and inline screenshots are generated, and the full step-by-step export process.

Managing Test Sessions

Understand how Valoraclick QA Tool auto-saves your session to JSON after every step, and how sessions are restored on next launch.

Build docs developers (and LLMs) love