[英]Run random test cases on TFS
I have schedule regression automation that is running everyday from TFS, I want to develop functionality to run only failed test case against latest build not whole regression automation again. 我有从TFS每天运行的计划回归自动化,我想开发功能以针对最新版本仅运行失败的测试用例,而不是再次运行整个回归自动化。
Is there a way, I can only call web api and pass only failed test case name and when I trigger deploy to any environment that will only run 有没有办法,我只能调用Web api并仅通过失败的测试用例名称,并且当我触发部署到将仅运行的任何环境时
Or is there any other way around this. 还是有其他解决方法。
There is already a Rerun failed tests
option in the v2.* of the VSTest task in the build definition, you could select this option to rerun the failed tests: 在构建定义的VSTest任务的v2。*版本中已经存在“ Rerun failed tests
选项,您可以选择以下选项来重新运行失败的测试:
If you want to use api, you would need to follow the steps below: 如果要使用api,则需要按照以下步骤操作:
GET https://{accountName}.visualstudio.com/{project}/_apis/test/Runs/{runId}/results?api-version=5.0-preview.5
POST https://{accountName}.visualstudio.com/{project}/_apis/test/Plans/{planId}/suites/{suiteId}?api-version=5.0-preview.3
Content-Type:application/json
{ "suiteType": "DynamicTestSuite", "name": "FailedTestCases", "queryString": "SELECT [System.Id],[System.WorkItemType],[System.Title],[Microsoft.VSTS.Common.Priority],[System.AssignedTo],[System.AreaPath] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] IN GROUP 'Microsoft.TestCaseCategory' AND ( [System.Id] = xxx OR [System.Id] = xxx )" }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.