Skip to content

Extensions ​

Extensions enhances the capability to provide richer and more contextualized information into your targets.

slack-link

TIP

While using multiple targets, extensions can be applied globally or on a per-target basis.

Supports ​

Extension types.

✅ CI Info

✅ Hyperlinks

✅ Mentions

✅ Metadata

✅ ReportPortal Analysis

✅ ReportPortal History

✅ Test Summary

✅ Percy Analysis

✅ Custom

Syntax ​

Command Line Mode ​

  • --ci-info (string) - show ci info.
  • --chart-test-summary (string) - show chart test summary.

Configuration Mode ​

json
{
  "name": "hyperlinks",
  "condition": "fail",
  "inputs": {
    "links": [
      {
        "text": "Build Logs",
        "url": "<build-logs-url>"
      }
    ]
  }
}
  • name (string) - name of the extension.

    hyperlinks, mentions, report-portal-analysis, report-portal-history, quick-chart-test-summary, percy-analysis, custom

  • condition? (condition) - condition of execute the extension.
  • hook? (string) - workflow hook to run.

    start, after-summary, end

  • inputs? (object) - custom inputs to run the extension.
    • title? (string) - title of the extension to be displayed. (applicable for most extensions)
    • title_link? (string) - attaches a clickable link to the title. (applicable for most extensions)

Examples (Command Line Mode) ​

sh
npx testbeats@latest publish --ci-info --chart-test-summary --slack '<incoming-webhook-url>' -junit '<path-to-junit-report>'

Examples (Configuration Mode) ​

Global Extensions ​

Extensions will be applied for both slack and teams targets.

json
{
  "targets": [
    {
      "name": "slack",
      "inputs": {
        "url": "<incoming-webhook-url>",
        "publish": "test-summary"
      }
    },
    {
      "name": "teams",
      "inputs": {
        "url": "<incoming-webhook-url>"
      }
    }
  ],
  "extensions": [
    {
      "name": "ci-info"
    }
  ],
  "results": [
    {
      "type": "testng",
      "files": ["path/to/testng-results.xml"]
    }
  ]
}

Per Target Extensions ​

json
{
  "targets": [
    {
      "name": "slack",
      "inputs": {
        "url": "<incoming-webhook-url>"
      },
      "extensions": [
        {
          "name": "ci-info"
        }
      ]
    }
  ],
  "results": [
    {
      "type": "testng",
      "files": ["path/to/testng-results.xml"]
    }
  ]
}

Released under the MIT License.