Track downloads and verify completion inside the verification loop (e.g., download_completed("report.csv") / downloadCompleted("report.csv")).
This page covers:
Downloads should be asserted, not assumed.
A browser agent can click “Download” and still fail to actually download the file. Treat downloads as a verifiable outcome.
Download capture is best-effort and depends on backend support, but the runtime tries to record:
The goal is not “perfect file system introspection,” but a reliable signal you can use in assertions.
Use the download predicate in a required assertion (or as a done gate).
from predicate import download_completed
# Gate step success on a specific file appearing as completed
runtime.assert(download_completed("report.csv"), "download_ok", required=True)from predicate import click, download_completed
runtime.begin_step("Download report")
snap = await runtime.snapshot(limit=80)
# (Find the download button your preferred way, then click it)
click(browser, element_id)
# Re-snapshot and verify the download finished
await runtime.snapshot()
runtime.assert(download_completed("report.csv"), "report_downloaded", required=True)If a download assertion fails: