'Azure Devops REST API: Publish test results including test steps
community. I want to publish my automation tests execution to DevOps Azure. The issue is that I cannot find the needed Request body that contains not only the status for the Test Case but also for each test step.
Thank you!
Solution 1:[1]
I cannot find the needed Request body that contains not only the status for the Test Case but also for each test step.
You can get the Request Body using TestPointUpdateParams:
PATCH https://dev.azure.com/{organization}/{project}/_apis/testplan/Plans/{planId}/Suites/{suiteId}/TestPoint?api-version=5.1-preview.2
POST https://dev.azure.com/{org name}/{project}/_apis/test/Runs/{runId}/results?api-version=5.0
{
"name": "myTest",
"build": { "id": "102" },
"isAutomated": true,
"state": "Waiting"
}
For each step, steps ID in XML:
{ "op": "add", "path": "/fields/Microsoft.VSTS.TCM.Steps",
"value": "<steps id=\"0\" last=\"1\"><step id=\"2\" type=\"ValidateStep\">
<parameterizedString isformatted=\"true\">Input step</parameterizedString>
<parameterizedString isformatted=\"true\">Expectation step </parameterizedString><description/></step></steps>" }
You can refer to Link Test Result with Test Case using REST API, Adding and updating tests within Azure DevOps Pipeline programmatically using API and REST API to post Steps and steps result of test case under Run(Results)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
