The Valoraclick QA Tool ships with a test suite in theDocumentation 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.
tests/ directory built on pytest. The suite is intentionally focused on the two layers most critical to report correctness: the pure business-logic functions in logic.py and the PDF generation service in services.py. Both test modules are standard unittest.TestCase classes, which pytest discovers and runs automatically.
Test Structure
| File | Type | What it covers |
|---|---|---|
tests/test_logic.py | Unit | validar_fecha() in logic.py — valid and invalid date strings |
tests/test_integration.py | Integration | PDFService.generate_report() — real PDF written to disk and verified |
Running the Tests
Activate the virtual environment
Open a terminal in the project root and activate
.venv so pytest and all dependencies are available:Run the full test suite
Execute all discovered tests with a single command:Alternatively, use the module invocation if
pytest is not on your PATH:Run with verbose output
Pass the Example output:
-v flag to see each individual test case listed with its pass/fail status:Unit Tests — test_logic.py
test_logic.py contains a TestLogic class that exercises validar_fecha() from logic.py. The function is expected to accept any properly formatted DD/MM/YYYY date and reject anything that does not match that pattern or represents an impossible calendar date.
tests/test_logic.py
| Input | Expected | Reason |
|---|---|---|
"30/04/2026" | True | Valid date in DD/MM/YYYY format |
"01/01/2024" | True | Valid date in DD/MM/YYYY format |
"32/01/2024" | False | Day 32 does not exist |
"ab/cd/efgh" | False | Non-numeric characters fail the regex |
"2026-04-30" | False | ISO format (YYYY-MM-DD) is not accepted |
Integration Tests — test_integration.py
test_integration.py contains a TestIntegration class that exercises PDFService.generate_report() end-to-end. It constructs a real ReportData object, populates it with one metadata entry and one test step, triggers the service, and then verifies that a non-empty PDF file was written to disk.
tests/test_integration.py
setUp— freshReportDataandPDFServiceinstances are created before each test method.test_creacion_pdf_con_datos— a tester name and onePassstep are added to the data, thengenerate_report()is called with the output pathtest_output_report.pdf.- Two assertions confirm the PDF exists on disk and has a non-zero file size, proving the fpdf2 rendering pipeline ran to completion.
tearDown— the generated PDF is deleted after each test run to keep the working directory clean.
The integration test generates a real PDF file (
test_output_report.pdf) in the current working directory — typically the project root when running pytest from there. tearDown deletes the file automatically after each run. Ensure the directory has write permissions before executing the test suite.