0.0.52 • Published 2 years ago

broadcast-test-results v0.0.52

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

broadcast-test-results

Publish test results to Microsoft Teams and Slack

Getting Started

npx broadcast-test-results publish -c path/to/config.json

Config

Configuration file holds the different configurations files for our reporting needs. We can specify the type of test results to be consumed and type of reports to be published.

Sample Config File

{
  "reports": [
    {
      "targets": [
        {
          "name": "teams",
          "url": "<teams-incoming-webhook-url>",
          "publish": "test-summary",
          "links": [{ "text": "Build Logs", "url": "<url>" }]
        }
      ],
      "results": [
        {
          "type": "testng",
          "files": ["path/to/testng-results.xml"]
        }
      ]
    }
  ]
}

Environment Variables

To use environment variables in the config file, wrap the environment variable name inside {}.

Example

{
  "links": [{ "text": "Build Logs", "url": "{BUILD_URL}" }]
}

Config File Properties

reports

PropertyDescriptionAttribute
targetslist of targets to publish reportsRequired
resultslist of results to parseRequired
optionscommon options for all targetsOptional

Supports

Results

Result TypeSupport
TestNG
JUnit
xUnit

Targets

TargetsSupport
Microsoft Teams
Slack
Custom

Teams

PropertyDescriptionAttribute
namename of the targetOptional
urlurl of the targetRequired
publishtype of report to publishOptional
linkslinks to be part of the reportOptional
titletitle of the reportOptional
title_suffixsuffix to add to titleOptional
report_portal_analysisreport portal analysis optionsOptional
Supported Report Types to Publish
  • test-summary
  • failure-summary
  • test-summary-slim
  • failure-summary-slim
  • failure-details
  • failure-details-slim
Report Portal Analysis Options
{
  "url": "<report-portal-base-url>",
  "api_key": "<api-key>",
  "project": "<project-id>",
  "launch_id": "<launch-id>"
}

Slack

PropertyDescriptionAttribute
namename of the targetOptional
urlurl of the targetRequired
publishtype of report to publishOptional
linkslinks to be part of the reportOptional
titletitle of the reportOptional
title_suffixsuffix to add to titleOptional
Supported Report Types to Publish
  • test-summary
  • failure-summary
  • test-summary-slim
  • failure-summary-slim
  • failure-details
  • failure-details-slim

Custom

PropertyDescriptionAttribute
namename of the targetRequired
pathpath to custom js fileRequired

Under Active Development

Examples

Defaults

  1. Identifies the target (slack or teams) based on the url.
  2. Defaults publish to test-summary report.
{
  "reports": [
    {
      "targets": [
        {
          "url": "<slack-incoming-webhook-url>"
        }
      ],
      "results": [
        {
          "type": "testng",
          "files": ["path/to/testng-results.xml"]
        }
      ]
    }
  ]
}

Custom

{
  "reports": [
    {
      "targets": [
        {
          "name": "custom",
          "path": "/relative/path/to/custom.js"
        }
      ],
      "results": [
        {
          "type": "junit",
          "files": ["path/to/junit-results.xml"]
        }
      ]
    }
  ]
}