Publish test results to Microsoft Teams and Slack
npx broadcast-test-results publish -c path/to/config.json
Configuration file holds the different configurations files for our reporting needs. We can specify the type of test results to be consumed and type of reports to be published.
{
"reports": [
{
"targets": [
{
"name": "teams",
"url": "<teams-incoming-webhook-url>",
"publish": "test-summary",
"links": [{ "text": "Build Logs", "url": "<url>" }]
}
],
"results": [
{
"type": "testng",
"files": ["path/to/testng-results.xml"]
}
]
}
]
}
To use environment variables in the config file, wrap the environment variable name inside {}
.
{
"links": [{ "text": "Build Logs", "url": "{BUILD_URL}" }]
}
Property |
Description |
Attribute |
targets |
list of targets to publish reports |
Required |
results |
list of results to parse |
Required |
options |
common options for all targets |
Optional |
Result Type |
Support |
TestNG |
✅ |
JUnit |
✅ |
xUnit |
✅ |
Targets |
Support |
Microsoft Teams |
✅ |
Slack |
✅ |
Custom |
✅ |
Property |
Description |
Attribute |
name |
name of the target |
Optional |
url |
url of the target |
Required |
publish |
type of report to publish |
Optional |
links |
links to be part of the report |
Optional |
title |
title of the report |
Optional |
title_suffix |
suffix to add to title |
Optional |
report_portal_analysis |
report portal analysis options |
Optional |
Supported Report Types to Publish
- test-summary
- failure-summary
- test-summary-slim
- failure-summary-slim
- failure-details
- failure-details-slim
Report Portal Analysis Options
{
"url": "<report-portal-base-url>",
"api_key": "<api-key>",
"project": "<project-id>",
"launch_id": "<launch-id>"
}
Property |
Description |
Attribute |
name |
name of the target |
Optional |
url |
url of the target |
Required |
publish |
type of report to publish |
Optional |
links |
links to be part of the report |
Optional |
title |
title of the report |
Optional |
title_suffix |
suffix to add to title |
Optional |
Supported Report Types to Publish
- test-summary
- failure-summary
- test-summary-slim
- failure-summary-slim
- failure-details
- failure-details-slim
Property |
Description |
Attribute |
name |
name of the target |
Required |
path |
path to custom js file |
Required |
Under Active Development
- Identifies the target (slack or teams) based on the url.
- Defaults publish to
test-summary
report.
{
"reports": [
{
"targets": [
{
"url": "<slack-incoming-webhook-url>"
}
],
"results": [
{
"type": "testng",
"files": ["path/to/testng-results.xml"]
}
]
}
]
}
{
"reports": [
{
"targets": [
{
"name": "custom",
"path": "/relative/path/to/custom.js"
}
],
"results": [
{
"type": "junit",
"files": ["path/to/junit-results.xml"]
}
]
}
]
}