How to Integrate Other Testing Frameworks with TestBeats ​
This guide shows you how to send test results from various testing frameworks to Slack, Microsoft Teams, or Google Chat using TestBeats.
What You'll Achieve ​
After following this guide, any testing framework that outputs standard test result formats (JUnit XML, JSON, etc.) will automatically send results to your team communication channels, complete with AI-powered failure analysis and detailed reporting.
Prerequisites ​
Before starting, ensure you have:
- A testing framework that can output results in a supported 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
Supported Frameworks & Formats ​
TestBeats supports multiple test result formats that work with various testing frameworks:
JUnit XML Format ​
Supported by:
- Java: JUnit 4/5, TestNG, Spock, Gradle Test
- JavaScript/TypeScript: Jest, Vitest, Karma, Jasmine
- Python: PyTest, unittest, nose2
- C#: NUnit, MSTest, xUnit.NET
- Ruby: RSpec, Minitest
- Go: go test with JUnit output
- PHP: PHPUnit
- Rust: cargo test with JUnit output
JSON Formats ​
Supported by:
- JavaScript: Mocha, Cucumber.js, Newman (Postman)
- Python: PyTest JSON, Robot Framework
- Java: Cucumber JVM, Karate
- Ruby: Cucumber Ruby
Custom Formats ​
Supported by:
- Performance Testing: JMeter (JTL/XML)
- API Testing: Newman (Postman Collections)
- Load Testing: Artillery, k6 (with custom reporters)
Step 1: Configure Your Framework ​
Choose the appropriate configuration based on your testing framework:
For JUnit XML Output ​
Most frameworks support JUnit XML output. Here are common configurations:
Jest (JavaScript):
{
"testResultsProcessor": "jest-junit",
"jest-junit": {
"outputDirectory": "test-results",
"outputName": "junit.xml"
}
}
PHPUnit (PHP):
<!-- phpunit.xml -->
<phpunit>
<logging>
<junit outputFile="test-results/junit.xml"/>
</logging>
</phpunit>
RSpec (Ruby):
# spec/spec_helper.rb
require 'rspec_junit_formatter'
RSpec.configure do |config|
config.add_formatter RSpecJUnitFormatter, 'test-results/junit.xml'
end
Go Test:
# Install go-junit-report
go install github.com/jstemmer/go-junit-report/v2@latest
# Run tests with JUnit output
go test -v ./... | go-junit-report -set-exit-code > test-results/junit.xml
For JSON Output ​
Newman (Postman):
newman run collection.json -r json --reporter-json-export test-results/newman.json
Robot Framework:
robot --outputdir test-results --output robot-output.xml tests/
Step 2: Run Your Tests ​
Execute your tests according to your framework's standard process. Ensure the output files are generated in the expected location.
Step 3: Choose Your Integration Method ​
You have two options to send results to TestBeats:
Option A: Command Line (Quick Setup) ​
For JUnit XML:
npx testbeats@latest publish \
--api-key '<your-api-key>' \
--slack '<your-webhook-url>' \
--junit 'test-results/junit.xml'
For JSON formats:
# Mocha JSON
npx testbeats@latest publish \
--api-key '<your-api-key>' \
--slack '<your-webhook-url>' \
--mocha 'test-results/mocha.json'
# Newman JSON
npx testbeats@latest publish \
--api-key '<your-api-key>' \
--slack '<your-webhook-url>' \
--newman 'test-results/newman.json'
Option B: Configuration File (Recommended) ​
Create a testbeats.config.json
:
{
"api_key": "<your-api-key>",
"targets": [
{
"name": "slack",
"inputs": {
"url": "<your-webhook-url>"
}
}
],
"results": [
{
"type": "junit",
"files": ["test-results/junit.xml"]
}
]
}
Then run:
npx testbeats@latest publish -c testbeats.config.json
Step 4: Framework-Specific Examples ​
Jest with TestBeats ​
Install Jest JUnit reporter:
npm install --save-dev jest-junit
Configure in package.json
:
{
"scripts": {
"test:report": "jest && testbeats publish -c testbeats.config.json"
},
"jest": {
"reporters": [
"default",
["jest-junit", { "outputDirectory": "test-results" }]
]
}
}
PHPUnit with TestBeats ​
Run tests with JUnit output:
phpunit --log-junit test-results/junit.xml
Integrate with Composer:
{
"scripts": {
"test:report": [
"phpunit --log-junit test-results/junit.xml",
"npx testbeats@latest publish -c testbeats.config.json"
]
}
}
Newman (Postman) with TestBeats ​
Run collection with JSON export:
newman run collection.json \
-e environment.json \
-r json \
--reporter-json-export test-results/newman.json
TestBeats configuration:
{
"results": [
{
"type": "newman",
"files": ["test-results/newman.json"]
}
]
}
Need Help with Your Framework? ​
If your testing framework isn't covered here:
- Check if it supports JUnit XML output - Most modern frameworks do
- Look for JSON export options - Many frameworks can export results as JSON
- Use custom scripts - Convert your framework's output to a supported format
- Contact support - Reach out for help with specific integrations
Example Integration ​
For working examples with various frameworks, see the TestBeats Examples Repository.
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
Looking for a specific framework? Check our Framework Integrations or contact support →