Skip to main content
Declare outputs in a test file to surface values (environment variables, extracted data, templated expressions) in the generated report.

1. Declare outputs

output-to-junit.test.yaml
fileType: momentic/test
name: output to junit
baseUrl: https://example.com
outputs:
  - name: PLAN_OUTPUT
    value: "{{ env.PLAN }}"
steps:
  - id: 625fba87-...
    type: PRESET_ACTION
    command:
      id: c791ef59-...
      type: JAVASCRIPT
      code: setVariable("PLAN", "team")

2. Run with the JUnit reporter

npx momentic run --reporter junit output-to-junit.test.yaml

3. Read the report

The output appears in the testOutputs property:
<testcase name="output to junit" time="2.833">
  <properties>
    <property name="filePath" value="output-to-junit.test.yaml"/>
    <property name="id" value="f5581d81-..."/>
    <property name="testOutputs">{"PLAN_OUTPUT":"team"}</property>
  </properties>
</testcase>