Reputation: 11
I am using the azure DevOps API to update the test results automatically after test automation run. From the documents, I am able to update the overall outcome of the test case using the below API. But I have a requirement to update each test step outcome result as well for which I didn't find any help in azure documentation. Is there a way to update test case steps outcome using Azure DevOps API? API used to update the test case outcome is https://learn.microsoft.com/en-us/rest/api/azure/devops/test/results/update?view=azure-devops-rest-5.1
Upvotes: 1
Views: 1479
Reputation: 30333
The test case steps is defined in actionResults of TestIterationDetailsModel in iterationDetails of the Request body TestCaseResult.
You can first use Get test results Api and specify the detailsToInclude=Iterations
to get the detailed iterationDetails
and actionResults
information of the TestCaseResults. And then you can construct your Request body and modify the iterationDetails
and actionResults
outcome according the TestCaseResults.
"https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results/{testCaseResultId}?detailsToInclude=Iterations&api-version=5.1"
I found an example to update the test step result in C# client API, you can check it out. Hope above helps.
Upvotes: 2