Hello there,
I try to make autoamtion sending messages to MS Teams webhook once test automation is created.
I would like to see test count, number of passed and failed test.
There is a documentation from Xray:
https://docs.getxray.app/display/XRAYCLOUD/Integration+with+Microsoft+Teams
However my messages are still without number regarding tests.
I don't know how to verify what is inside these variables like:
{{webResponse.body.data.getTestExecution.testRuns.results.status.name.match(".*(PASSED).*").size|0}}
I make script in python to see what is in response json:
{'data': {'getTestExecution': {'issueId': '1028525', 'jira': {'key': 'CTB-4977', 'customfield_10033': None}, 'testRuns': {'results': [{'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4847'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4848'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4849'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4873'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4850'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4615'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4972'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4678'}}}]}, 'testEnvironments': [], 'testPlans': {'results': []}}}}
Automation log also confirm all my posts were successful ( so token etc should be correct )
So question is if these variables are up to date in xray documentation?
How can i check what is inside these variables?
Or do you have any other idea how to get information like test count, passed and failed tests?
There is better structured json file:
json_data = <span>'''{
"data": {
"getTestExecution": {
"issueId": "1028525",
"jira": {"key": "CTB-4977", "customfield_10033": None},
"testRuns": {
"results": [
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4847"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4848"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4849"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4873"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4850"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4615"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4972"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4678"}}}
]
},
"testEnvironments": [],
"testPlans": {"results": []}
}
}
}'''</span>