Report
Create your own customizable test reports.
Overview
Manufacturing test reports often need static, formatted outputs for compliance, export, and sharing, beyond structured test steps and attachments. TofuPilot allows you to programmatically create these reports for each run.
Each run report is generated from a Report template defined in the Procedure and can be dynamically modified using values obtained during the run.
Integration
You can customize your report in the in-app Report template on the Procedure page, then use report_variables
to auto-fill it when the test uploads to TofuPilot. You can find the filled report on the Run page.
from tofupilot import TofuPilotClient
from datetime import datetime
def get_unit_under_test():
return {"serial_number": "PCB1A001", "batch_number": "1024"}
def main():
client = TofuPilotClient()
uut = get_unit_under_test()
client.create_run(
procedure_id="FVT1",
unit_under_test={
"serial_number": uut["serial_number"],
"part_number": "PCB1",
"batch_number": uut["batch_number"],
},
run_passed=True,
report_variables={
"motor_serial_number": uut["serial_number"],
"motor_batch_number": uut["batch_number"],
"production_date": str(datetime.now().strftime("%d.%m.%Y")),
"report_date": str(datetime.now().strftime("%d.%m.%Y")),
"safety_test_status": "Passed",
},
)
if __name__ == "__main__":
main()
The report_variables parameter should be a dictionary, with each key-value pair representing a variable. Keys are the variable names as strings, and values are the corresponding variable values as strings.
Insert variable field
You need to define your report template in the Report template section on the Procedure page by clicking the Edit
button. Create variables by wrapping the name in double curly brackets: {{variable-name}}
. These become customizable inputs.
Variables can be inserted into any editor block (lists, tables, code blocks, etc.) and can include applied styles.
In-app view
Access the report of the new run in the Report section on the Run page, where the variables are automatically filled.
Report template
The editor in the Report template section on the Procedure page 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, Horizontal Rule |
Text Styling | Quote, Blockquote, Paragraph |
Lists | Bullet Points, Numbered List, To-Do List |
Marks | Bold, Italic, Underline, Strikethrough, Link, Highlight, Code |
Pressing /
in your editor brings up a full menu of content blocks you can choose to insert.