Skip to content

How to Integrate JUnit XML with TestBeats ​

This guide shows you how to send JUnit XML test results to Slack, Microsoft Teams, or Google Chat using TestBeats.

What You'll Achieve ​

After following this guide, any testing framework that outputs JUnit XML reports will automatically send results to your team communication channels, complete with AI-powered failure analysis and detailed reporting.

What is JUnit XML? ​

JUnit XML is a standardized format for test results that's supported by most testing frameworks including:

  • Java: JUnit, TestNG, Selenium
  • JavaScript: Cypress, Playwright, WebdriverIO, Jest
  • Python: PyTest, unittest
  • C#: NUnit, MSTest
  • Ruby: RSpec, Minitest

Prerequisites ​

Before starting, ensure you have:

  • Test results in JUnit XML format
  • TestBeats installed (npx testbeats@latest --version)
  • A webhook URL for your communication platform (Slack, Teams, or Chat)
  • (Optional) TestBeats API key from app.testbeats.com

Step 1: Generate JUnit XML Reports ​

Configure your testing framework to output JUnit XML. The exact method depends on your framework - see our specific framework guides for detailed instructions.

Step 2: Choose Your Integration Method ​

You have two options to send results to TestBeats:

Option A: Command Line (Quick Setup) ​

For quick testing or simple setups:

bash
npx testbeats@latest publish \
  --api-key '<your-api-key>' \
  --slack '<your-webhook-url>' \
  --junit 'results/junit-*.xml'

For more control and CI/CD integration, create a testbeats.config.json:

json
{
  "api_key": "<your-api-key>",
  "targets": [
    {
      "name": "slack",
      "inputs": {
        "url": "<your-webhook-url>"
      }
    }
  ],
  "results": [
    {
      "type": "junit",
      "files": ["results/junit-*.xml"]
    }
  ]
}

Then run:

bash
npx testbeats@latest publish -c testbeats.config.json

Example Integration ​

For framework-specific examples, see our dedicated guides:

Next Steps ​


Need help with a specific framework? Check Framework Integrations →

Released under the MIT License.