Output Values
Output values allow you to extract and export critical attributes from your managed test resources (such as issue numbers, URLs, and IDs) to make them easily consumable by CI/CD pipelines, Pull Request comments, or subsequent stages.
1. Declaring Outputs in main.yml
Section titled “1. Declaring Outputs in main.yml”Outputs can be declared in main.yml, output.yml, or domain files:
output: # 1. Provider-computed attribute smoke_issue_number: description: "Issue number of the generated Test Run in GitHub/GitLab" value: "${testrun.suites/smoke.run.feature.@tr-1.issueNumber}"
# 2. Report web URL report_web_url: description: "Web link to attach to Pull Request comments" value: "${testrun.suites/smoke.run.feature.@tr-1.url}"
# 3. Universal resource identifier auth_testcase_id: value: "${testcase.auth/login.case.feature.@tc-1.remoteId}"
# 4. Sensitive output ci_token: value: "${var.secret_token}" sensitive: true2. Reading Outputs with testform output
Section titled “2. Reading Outputs with testform output”After running testform apply, output values are persisted in the state file and can be queried via CLI:
Standard Display
Section titled “Standard Display”$ testform outputauth_testcase_id = "local:25"report_web_url = "https://github.com/my-org/qa-repo/issues/29"smoke_issue_number = 29JSON Format (CI/CD)
Section titled “JSON Format (CI/CD)”$ testform output -json{ "smoke_issue_number": { "sensitive": false, "type": "number", "value": 29 }}Raw Value (Pipelines)
Section titled “Raw Value (Pipelines)”$ ISSUE_ID=$(testform output smoke_issue_number -raw)$ echo "Test run issue: $ISSUE_ID"