Publish test results to Microsoft Teams and Slack
npx test-results-reporter 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 |
Property | Description | Attribute |
---|---|---|
name | name of the target | Required/Optional |
url | url of the target | Required/Optional |
publish | type of report to publish | Required/Optional |
links | links to be part of the report | Optional |
title | title of the report | Optional |
title_suffix | suffix to add to title | Optional |
path | path to custom js file | Optional |
Targets | Support |
---|---|
Microsoft Teams | ✅ |
Slack | ✅ |
Custom | ✅ |
Supported Report Types
- test-summary
- failure-summary
- test-summary-slim
- failure-summary-slim
- failure-details
- failure-details-slim
Result Type | Support |
---|---|
TestNG | ✅ |
JUnit | ✅ |
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"]
}
]
}
]
}