Skip to content

Extensions Reference ​

Extensions enhance TestBeats' capability to provide richer and more contextualized information in your notification targets. They add additional data, formatting, and functionality to your test reports.

Extensions Example

Available Extensions ​

Core Extensions ​

đźš§ CI Info - Display CI/CD pipeline information (coming soon) đźš§ Hyperlinks - Add clickable links to reports (coming soon) đźš§ Mentions - Mention team members and groups (coming soon) đźš§ Metadata - Include custom metadata and context (coming soon)

Analysis Extensions ​

đźš§ Chart Test Summary - Visual test result charts (coming soon) đźš§ ReportPortal Analysis - ReportPortal integration (coming soon) đźš§ ReportPortal History - Historical ReportPortal data (coming soon) đźš§ Percy Analysis - Visual regression testing integration (coming soon)

Custom Extensions ​

đźš§ Custom - Create your own custom extensions (coming soon)

How Extensions Work ​

Extensions are modular components that can be added to your TestBeats configuration to enhance the information displayed in your notification targets. They work by:

  1. Processing test data - Extensions analyze your test results and extract relevant information
  2. Enriching reports - They add context, metadata, and visual elements to your reports
  3. Enhancing notifications - Extensions can modify how information is presented in Slack, Teams, and other targets

Extension Configuration ​

Extensions are configured in your testbeats.json file under the extensions section:

json
{
  "targets": [
    {
      "name": "slack",
      "inputs": {
        "url": "{SLACK_WEBHOOK_URL}"
      },
      "extensions": [
        {
          "name": "ci-info",
          "enabled": true
        },
        {
          "name": "mentions",
          "enabled": true,
          "inputs": {
            "users": ["@developer", "@qa-team"]
          }
        }
      ]
    }
  ]
}

Common Extension Patterns ​

Conditional Extensions ​

json
{
  "name": "mentions",
  "enabled": true,
  "condition": "result == 'failed'",
  "inputs": {
    "users": ["@on-call-engineer"]
  }
}

Environment-Specific Extensions ​

json
{
  "name": "hyperlinks",
  "enabled": true,
  "inputs": {
    "build_url": "{BUILD_URL}",
    "logs_url": "{LOGS_URL}"
  }
}

Extension Development ​

Extensions follow a standardized API that allows them to:

  • Access test result data
  • Retrieve environment variables and CI/CD context
  • Generate formatted output for different targets
  • Integrate with external services and APIs

Extension Interface ​

javascript
// Extension structure
{
  name: "extension-name",
  version: "1.0.0",
  process: (testData, config, context) => {
    // Process test data and return enhanced content
    return {
      content: "Enhanced content",
      metadata: { /* additional data */ }
    };
  }
}

Best Practices ​

Performance Considerations ​

  • Minimize API calls - Cache external data when possible
  • Fail gracefully - Don't break reports if extension fails
  • Timeout handling - Set reasonable timeouts for external services

Configuration Management ​

  • Use environment variables for sensitive data
  • Provide sensible defaults for optional configuration
  • Validate configuration before processing

Target Compatibility ​

  • Test across targets - Ensure extensions work with Slack, Teams, etc.
  • Format appropriately - Different targets have different formatting capabilities
  • Handle limitations - Some targets have message size or formatting restrictions

For creating custom extensions, detailed information about the extension API and development guidelines will be available in future releases.

Released under the MIT License.