Skip to content

Outputs

Output Values in Testform allow you to extract and export data generated during test execution (remote IDs, report URLs, execution metrics, tokens) for downstream consumption in CI/CD pipelines or across modules.

Directly mirroring Terraform’s output block, outputs are persisted in the state ledger (testform.state) upon successful testform apply.


Outputs can be declared in output.yml or root main.yml:

# main.yml or output.yml
output:
login_case_title:
description: "Title of the authentication scenario"
value: "${testcase.auth/login.case.feature.@tc-1.title}"
smoke_run_id:
description: "Remote Run ID from execution provider"
value: "${testrun.suites/smoke.run.feature.@tr-1.remoteId}"
report_url:
description: "Direct URL to generated HTML report"
value: "${local.base_url}/reports/${testrun.suites/smoke.run.feature.@tr-1.remoteId}"

Query stored outputs from the state ledger at any time:

Ventana de terminal
testform output
login_case_title = "Successful login"
smoke_run_id = "local:15"
report_url = "https://app.com/reports/local:15"

Perfect for shell scripts or CI/CD environment exports:

Ventana de terminal
export RUN_ID=$(testform output smoke_run_id -raw)

Process outputs programmatically with tools like jq:

Ventana de terminal
testform output -json

When consuming child modules via @module, their outputs are scoped under module.<name>.<output> and can be referenced in consumer scenarios or root output: blocks:

Scenario: Reusing session token from auth module
Given request header is set to "Authorization: Bearer ${module.auth_module.auth_token}"
When user queries protected endpoint
Then response status is 200 OK