Report
Beyond structured test steps and attachments, manufacturing test reports sometimes need to produce static formatted reports to facilitate compliance, exporting, and sharing. Tofupilot enables the creation of these types of reports programmatically for each run.
This guide explains how to use Tofupilot’s report feature to create, customize, and export test run reports.
Report Template
Each run report is generated from a report template defined in the procedure, with a variable system allowing dynamic modification during the creation of the run using values obtained during the run.
Create report template
Open the page of the procedure for which you want the runs to have a report, navigate to the Report Template section, and then click on the Edit
button.
Tofupilot provides a collaborative rich text editor to help you create a report template in the desired format.
The editor provides a full set of blocks and marks to create rich reports:
Category | Type |
---|---|
Headings | Heading levels 1, 2, 3 |
Content | Paragraph, Table, Code Block, Image |
Text Styling | Quote, Blockquote, Paragraph |
Layout | Horizontal Rule, Hard Break |
Marks | Bold, Italic, Underline, Strikethrough, Link, Highlight, Code |
Insert variable field
To create variables in a procedure report template, wrap the variable name in double curly brackets: {{variable-name}}
. These fields will then become customizable inputs.
Variables can be inserted into any editor block (lists, tables, code blocks, etc.) and can include applied styles.
Example
Create a run from the procedure and use the report_variables
parameter to populate the variables fields.
create_run_report.py
from tofupilot import TofuPilotClient
client = TofuPilotClient()
def test_function():
# your test execution goes here
run_passed = True
report_variables={
"t-processor": "75°C",
"status-processor": "Pass",
"t-regulator": "78°C",
"status-regulator": "Pass",
"t-memory": "64°C",
"status-memory": "Pass",
"t-power": "72°C",
"status-power": "Pass",
}
return run_passed, report_variables
run_passed, report_variables = test_function()
client.create_run(
procedure_id="SOP-35",
unit_under_test={
"serial_number": "0001",
},
run_passed=run_passed,
report_variables=report_variables
)
Run Page
Access the report of the newly created run where variables have been automatically populated.