01
Expose a safe workflow contract
A workflow launched from QaCockpit must support workflow_dispatch. QaCockpit discovers its declared inputs and sends only validated values from that allow-list together with the selected top-level Git ref.
on:
workflow_dispatch:
inputs:
scenario:
description: Evidence scenario
required: true
default: green
type: choice
options: [green, failed-test, scope-drift]- Use typed, non-secret inputs for selectors such as browser, shard, or scenario.
- Do not add an upload token or a required
portal_run_idinput. - Environment remains QaCockpit execution metadata unless your own workflow explicitly needs another input.
- Artifact names and JUnit paths can follow your repository conventions.
02
Create and retain Playwright JUnit XML
Let the test step finish with a captured outcome, always upload the report and useful browser evidence, then restore the original failing conclusion. This prevents a failed test from skipping artifact retention or turning the job green.
- name: Run Playwright and create JUnit XML
id: tests
continue-on-error: true
env:
PLAYWRIGHT_JUNIT_OUTPUT_FILE: test-results/junit.xml
run: npx playwright test --reporter=junit
- name: Retain JUnit and browser evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-test-evidence
if-no-files-found: error
retention-days: 14
path: |
test-results/junit.xml
test-results/**
playwright-report/**
- name: Preserve the test conclusion
if: steps.tests.outcome == 'failure'
run: exit 1Inspect the publicPlaywright workflowand a successful evidence run.
03
Retain Maven Surefire reports
Maven Surefire writes JUnit-style XML to target/surefire-reports by default. Retain every TEST-*.xml file because one test class commonly produces one report.
- name: Run REST Assured and create Surefire XML
id: tests
continue-on-error: true
run: mvn --batch-mode test
- name: Retain JUnit XML and API diagnostics
if: always()
uses: actions/upload-artifact@v7
with:
name: rest-assured-test-evidence
if-no-files-found: error
retention-days: 14
path: |
target/surefire-reports/TEST-*.xml
target/surefire-reports/*.txt
target/test-evidence/**
- name: Preserve the test conclusion
if: steps.tests.outcome == 'failure'
run: exit 1Inspect the publicREST Assured workflowand a successful evidence run.
04
What happens after the workflow completes
- GitHub sends the signed workflow completion event to QaCockpit.
- QaCockpit resolves the exact workflow run and attempt for the Test Source.
- The GitHub App lists and downloads retained artifacts for that run.
- Compatible JUnit XML is discovered by content, normalized, and attached to the execution.
- Other retained files can remain available as protected failure evidence.
05
Troubleshoot an execution awaiting results
- Confirm the selected workflow and branch match the Test Source.
- Open the run summary and verify that the JUnit artifact exists and is not empty.
- Use
if: always()so failed tests do not skip artifact retention. - Use a unique artifact name per matrix job; immutable artifacts cannot be extended by several jobs.
- Refresh GitHub inventory after changing repository or workflow access.
Provider references:GitHub workflow artifactsand actions/upload-artifact.
