1
votes

we implemented UI tests for a web application using cypress and they are executed on a release pipeline in Azure DevOps.

We need to link the ui tests and test results with our test cases defined in the test plans. For linking the ui tests with the test cases we retrieve the automated test results using the API-URL:

_apis/tcm/ResultsByRelease?releaseId={}&publishContext=CI&%24top=20000

...once we retrieve the results, I can link the test cases in the test plan to automated tests using the Microsoft.TeamFoundation.WorkItemTracking.WebApi (Method: UpdateWorkItemAsync). Our UI tests have the ID of the test case as attribute, so I can use that to link them.

We can't change the outcome of the test cases based on the retrieved results. I’ve found there is the concept of test point, but I could not find what it is for. In the REST API documentation this the resource has the outcome of test cases. According to the documentation, test point cannot be created only updated based on run, if a understood correctly.

Any ideas, how we can change the outcome of the test cases?

Thanks,

P

1

1 Answers

0
votes

You can try getting the test points with below api.

https://docs.microsoft.com/en-us/rest/api/azure/devops/testplan/test%20point/get%20points%20list?view=azure-devops-rest-5.1

You can then iterate the test points results from above step and to get each test point id. Then try updating the outcome of each test point with api here

If your project is developed with visualstudio. You can associate these test results and test case via visual studio. And the outcome would be automatically updated when the test cases completed in release pipeline.

To associate tests with test cases in test plan, check here.

To run tests from test plan, check here