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:
npx testbeats@latest publish \
--api-key '<your-api-key>' \
--slack '<your-webhook-url>' \
--junit 'results/junit-*.xml'
Option B: Configuration File (Recommended) ​
For more control and CI/CD integration, create a testbeats.config.json
:
{
"api_key": "<your-api-key>",
"targets": [
{
"name": "slack",
"inputs": {
"url": "<your-webhook-url>"
}
}
],
"results": [
{
"type": "junit",
"files": ["results/junit-*.xml"]
}
]
}
Then run:
npx testbeats@latest publish -c testbeats.config.json
Example Integration ​
For framework-specific examples, see our dedicated guides:
Next Steps ​
- Configure additional targets for multiple communication channels
- Set up CI/CD integration for automated reporting
- Explore advanced extensions for enhanced reporting
- Learn about TestBeats Portal features
Need help with a specific framework? Check Framework Integrations →