Via the UI, currently it is not possible.
But you can use Azure API for this.
import requests
import json
organization = 'your_organization'
project = 'your_project'
plan_id = 'your_test_plan_id'
pat = 'your_pat'
suite_ids = ['suite_id1', 'suite_id2', 'suite_id3', ....]
headers = {
'Content-Type': 'application/json',
'Authorization': f'Basic {pat}'
}
def create_chart(suite_id, chart_name, query, settings):
url = f'https://dev.azure.com/{organization}/{project}/_apis/test/Plans/{plan_id}/suites/{suite_id}/charts?api-version=6.0-preview'
payload = {
"name": chart_name,
"query": query,
"settings": settings
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
if response.status_code == 200:
print(f'Successfully created chart {chart_name} for suite {suite_id}')
else:
print(f'Failed to create chart {chart_name} for suite {suite_id}: {response.content}')
for suite_id in suite_ids:
create_chart(suite_id, "Outcome of Test", "Outcome query", {/* your settings */})
create_chart(suite_id, "Who ran the Test", "Runner query", {/* your settings */})
PATH is the token to the API.
Replace also organization and project with your particular data.
The settings can be like this:
settings = {
"chartType": "Bar",
"xAxis": "Outcome",
"yAxis": "Count",
"series": [
{
"name": "Passed",
"color": "Green"
},
{
"name": "Failed",
"color": "Red"
}
],
"filters": {
"testSuite": suite_id,
"dateRange": {
"start": "2023-01-01",
"end": "2023-12-31"
}
}
}
Documentation: https://learn.microsoft.com/en-us/dotnet/api/microsoft.office.tools.excel.chart?view=vsto-2022