Skip to content

Upload Command

The qf upload command parses test result files and uploads them to Qualflare. It supports 19 different test frameworks across five categories: Unit Testing, BDD, UI/E2E Testing, API Testing, and Security Testing.

Basic Syntax

bash
qf upload [files...] [flags]

Arguments

ArgumentDescription
files...One or more test result files to upload. Supports glob patterns like *.xml or **/*.json

Examples

bash
# Upload a single JUnit XML file
qf upload results.xml --project my-app --format junit

# Auto-detect format from file
qf upload playwright-results.json --project my-app

# Upload multiple files with glob pattern
qf upload test-results/*.xml --project my-app --format junit

# Specify environment and git metadata
qf upload results.xml --project my-app --environment staging --branch main --commit abc123

# Dry run - parse without uploading
qf upload results.xml --project my-app --dry-run

# Output parsed results as JSON (use with dry-run)
qf upload results.xml --project my-app --dry-run --output json

Flags

All flags can be provided as command-line options or set via environment variables (see CI/CD Integration).

FlagShortTypeDefaultDescription
--format-fstring"" (auto-detect)Test framework format. Use qf list-formats to see all supported formats.
--project-pstring""Project name in Qualflare. Defaults to the project associated with your API key.
--environment-estring""Environment name (e.g., staging, production, dev)
--branchstring""Git branch name (e.g., main, develop, feature/login)
--commitstring""Git commit hash for tracking which code version was tested
--api-endpointstring""Qualflare API endpoint URL. Overrides default API endpoint.
--api-keystring""API key for authentication. Overrides QUALFLARE_API_KEY environment variable.
--timeoutduration30sRequest timeout. Valid units: s (seconds), m (minutes). Example: --timeout 2m
--dry-runboolfalseParse files without uploading to Qualflare. Useful for validation and debugging.
--output-ostring""Output format for dry-run mode. Currently supports json.
--verbose-vboolfalseEnable verbose output for debugging.
--quiet-qboolfalseSuppress non-error output. Useful for CI/CD scripts.

Flag Descriptions

--format / -f

Specifies the test framework format. If not provided, the CLI attempts to auto-detect the format based on file content and extension.

bash
qf upload results.xml --format junit
qf upload results.json --format playwright

--project / -p

Associates the upload with a specific project in Qualflare. If not provided, uses the default project from your API key.

bash
qf upload results.xml --project my-web-app

--environment / -e

Labels the test run with an environment name. Useful for filtering results by deployment environment.

bash
qf upload results.xml --environment staging
qf upload results.xml --environment production

--branch and --commit

Git metadata for tracking which code version was tested. Enables integration with Git workflows.

bash
qf upload results.xml --branch main --commit a1b2c3d

In CI/CD, these are often auto-populated:

bash
# GitHub Actions
qf upload results.xml --branch ${GITHUB_REF#refs/heads/} --commit ${GITHUB_SHA}

# GitLab CI
qf upload results.xml --branch ${CI_COMMIT_REF_NAME} --commit ${CI_COMMIT_SHA}

--api-endpoint and --api-key

Override the default API endpoint or provide an API key directly.

bash
qf upload results.xml --api-endpoint https://api.qualflare.com --api-key your-key

Best practice is to use environment variables instead (see CI/CD Integration).

--timeout

Sets the HTTP request timeout for uploading to Qualflare. Default is 30 seconds.

bash
qf upload results.xml --timeout 2m  # 2 minutes

--dry-run

Parse and validate test files without uploading. Useful for:

  • Validating file format
  • Debugging parsing issues
  • Previewing what will be uploaded
bash
qf upload results.xml --dry-run
# Output: OK Test results parsed successfully (dry run)

--output / -o

Used with --dry-run to output parsed results as JSON. Useful for debugging and integration.

bash
qf upload results.xml --dry-run --output json

Global Flags

These flags are available on all commands:

FlagShortDescription
--verbose-vEnable detailed debug output
--quiet-qSuppress all non-error output

Exit Codes

CodeMeaning
0Success - test results uploaded or validated successfully
1Error - file not found, parse error, upload failed, or invalid configuration
2Usage error - invalid arguments or flags

Error Handling

The CLI provides clear error messages for common issues:

File Not Found

bash
$ qf upload missing.xml
ERR file does not exist: missing.xml

Invalid Format

bash
$ qf upload results.xml --format unsupported
ERR unsupported format: unsupported. Use 'qf list-formats' to see supported formats

Parse Error

bash
$ qf upload invalid.xml
ERR failed to parse test results: invalid XML format

Authentication Error

bash
$ qf upload results.xml
ERR failed to process test results: unauthorized (invalid API key)

Network Error

bash
$ qf upload results.xml
ERR failed to process test results: connection refused

Supported Frameworks

The qf upload command supports 19 test frameworks across five categories. Use the --format flag to specify your framework, or let the CLI auto-detect it.

Unit Testing Frameworks

Framework--format ValueExpected File FormatDescription
JUnitjunitXMLStandard JUnit XML format. Used by Java, Android, and many other tools.
Python (pytest)pythonXMLpytest XML output (--junitxml flag).
GogoJSONGo test output with -json flag.
JestjestJSONJest JSON test results.
MochamochaJSONMocha JSON reporter output.
RSpecrspecJSONRSpec JSON formatter output.
PHPUnitphpunitXMLPHPUnit XML日志文件 (JUnit compatible).

Example Unit Test Uploads

bash
# JUnit (Java, Android, etc.)
qf upload build/test-results/test/*.xml --format junit --project my-app

# pytest
qf upload pytest-report.xml --format python --project my-app

# Go tests
qf upload go-test.json --format golang --project my-app

# Jest
qf upload jest-results.json --format jest --project my-app

# Mocha
qf upload mocha-report.json --format mocha --project my-app

# RSpec
qf upload rspec-report.json --format rspec --project my-app

# PHPUnit
qf upload phpunit-report.xml --format phpunit --project my-app

BDD Frameworks

Framework--format ValueExpected File FormatDescription
CucumbercucumberJSONCucumber JSON report format.
KaratekarateJSONKarate test automation JSON output.

Example BDD Uploads

bash
# Cucumber
qf upload cucumber-report.json --format cucumber --project my-app

# Karate
qf upload karate-report.json --format karate --project my-app

UI / E2E Testing Frameworks

Framework--format ValueExpected File FormatDescription
PlaywrightplaywrightJSONPlaywright JSON test results.
CypresscypressJSONCypress test results JSON output.
SeleniumseleniumJSONSelenium WebDriver JSON output.
TestCafetestcafeJSONTestCafe JSON reporter output.

Example E2E Uploads

bash
# Playwright
qf upload playwright-results.json --format playwright --project my-app

# Cypress
qf upload cypress-results.json --format cypress --project my-app

# Selenium
qf upload selenium-results.json --format selenium --project my-app

# TestCafe
qf upload testcafe-report.json --format testcafe --project my-app

API Testing Frameworks

Framework--format ValueExpected File FormatDescription
NewmannewmanJSONPostman Newman test run output.
k6k6JSONk6 load test results JSON summary.

Example API Uploads

bash
# Newman (Postman)
qf upload newman-report.json --format newman --project my-app

# k6
qf upload k6-summary.json --format k6 --project my-app

Security Testing Tools

Tool--format ValueExpected File FormatDescription
OWASP ZAPzapJSONZAP security scan JSON report.
TrivytrivyJSONTrivy vulnerability scan JSON output.
SnyksnykJSONSnyk security test JSON results.
SonarQubesonarqubeJSONSonarQube quality gate JSON report.

Example Security Uploads

bash
# OWASP ZAP
qf upload zap-report.json --format zap --project my-app

# Trivy
qf upload trivy-results.json --format trivy --project my-app

# Snyk
qf upload snyk-test.json --format snyk --project my-app

# SonarQube
qf upload sonarqube-report.json --format sonarqube --project my-app

Auto-Detection

If you don't specify --format, the CLI will attempt to auto-detect the format based on:

  • File extension (.xml, .json)
  • File content patterns
  • Common framework-specific markers

For reliable results, explicitly specify the format when dealing with ambiguous files.

bash
# Auto-detection
qf upload results.json --project my-app

# Explicit format (recommended)
qf upload results.json --format playwright --project my-app

Usage Examples

CI/CD Integration

Upload test results as part of your CI/CD pipeline:

bash
# GitHub Actions
- name: Upload test results to Qualflare
  run: |
    qf upload test-results/*.xml \
      --project my-app \
      --environment staging \
      --branch ${GITHUB_REF#refs/heads/} \
      --commit ${GITHUB_SHA}
  env:
    QUALFLARE_API_KEY: ${{ secrets.QUALFLARE_API_KEY }}

Multiple Test Suites

Upload results from multiple test types:

bash
# Unit tests
qf upload unit-results.xml --format junit --project my-app --environment testing

# E2E tests
qf upload e2e-results.json --format playwright --project my-app --environment testing

# Security scan
qf upload security-report.json --format trivy --project my-app --environment testing

Dry Run Validation

Validate your test results before uploading:

bash
# Validate file can be parsed
qf upload results.xml --format junit --dry-run

# Preview what will be sent
qf upload results.xml --format junit --dry-run --output json

Verbose Debugging

Enable verbose output for debugging:

bash
qf upload results.xml --verbose
# Output includes:
# - Processing 1 test result file(s)...
# - Detected format: junit
# - Parsing file...
# - Uploading to Qualflare...
# - OK Test results uploaded successfully

See Also