Metadata Extension ​
With Metadata, you can include extra information such as environment details, test configurations, execution time, and more. This additional data helps your team gain a deeper understanding of each test run, facilitating better analysis and faster resolution of issues. By incorporating Metadata into your TestBeats notifications, you ensure that every piece of relevant information is at your team's fingertips, enhancing clarity and efficiency in your testing processes.
Configuration ​
Basic Syntax ​
json
{
"name": "metadata",
"inputs": {
"data": [
{
"key": "Browser",
"value": "chrome"
},
{
"value": "1920 x 1080"
},
{
"key": "Build Logs",
"value": "<build-logs-url>",
"type": "hyperlink"
},
{
"key": "Screenshots",
"value": "<screenshots-url>",
"type": "hyperlink",
"condition": "fail"
}
]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Parameters ​
data
(object[]) - List of metadata objectskey
(string) - Text to display as a key (optional for simple values)value
(string) - Text to display as a valuetype
(string) - Type of metadata. Allowed values:hyperlink
condition
(condition) - Condition to include this metadata
Default Behavior ​
- Hook:
end
- Condition:
passOrFail
Examples ​
Basic Metadata ​
Include simple key-value information:
json
{
"targets": [
{
"name": "slack",
"inputs": {
"url": "{SLACK_WEBHOOK_URL}"
}
}
],
"extensions": [
{
"name": "metadata",
"inputs": {
"data": [
{
"key": "Browser",
"value": "Chrome 120.0.6099.109"
},
{
"key": "Environment",
"value": "{ENVIRONMENT}"
}
]
}
}
],
"results": [
{
"type": "testng",
"files": ["path/to/testng-results.xml"]
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Conditional Metadata ​
Show different information based on test results:
json
{
"targets": [
{
"name": "slack",
"inputs": {
"url": "{SLACK_WEBHOOK_URL}"
}
}
],
"extensions": [
{
"name": "metadata",
"inputs": {
"data": [
{
"key": "Screenshots",
"value": "https://screenshots.example.com/{BUILD_ID}",
"type": "hyperlink",
"condition": "fail"
},
{
"key": "Build Logs",
"value": "https://ci.example.com/logs/{BUILD_ID}",
"type": "hyperlink",
"condition": "{process.env.CI} === 'true'"
}
]
}
}
],
"results": [
{
"type": "testng",
"files": ["path/to/testng-results.xml"]
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Related Documentation ​
- Extensions Overview - Complete extensions reference
- Hyperlinks Extension - Dedicated link management
- CI Info Extension - Automated CI/CD information
- Configuration Guide - General configuration help