【问题标题】:Does Azure provide Rest APIs for posting test automation results to Azure Devops Testlabs?Azure 是否提供用于将测试自动化结果发布到 Azure Devops Testlabs 的 Rest API?
【发布时间】:2020-12-04 09:53:55
【问题描述】:
我们正在使用 AZURE 测试管理来创建测试套件和测试计划。
我们为 Azure 中的所有测试套件提供了 selenium 自动化。
运行自动化测试后,我们需要将自动化结果发布到 Azure 测试套件中的相应测试用例。
Azure 是否提供了任何 REST API 来实现这一点?
提前致谢
拉杰什
【问题讨论】:
标签:
azure-devops
automated-tests
azure-rest-api
【解决方案1】:
Azure 是否提供用于将测试自动化结果发布到 Azure Devops Testlabs 的 Rest API?
答案是肯定的。
您可以使用 REST API Results - Add 来测试运行结果:
POST https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results?api-version=6.0
请求正文:
[
{
"testCaseTitle": "VerifyWebsiteTheme",
"automatedTestName": "FabrikamFiber.WebSite.TestClass.VerifyWebsiteTheme",
"priority": 1,
"outcome": "Passed"
},
{
"testCaseTitle": "VerifyWebsiteLinks",
"automatedTestName": "FabrikamFiber.WebSite.TestClass.VerifyWebsiteLinks",
"priority": 2,
"outcome": "Failed",
"associatedBugs": [
{
"id": 30
}
]
}
]
您可以查看this thread 和this thread 了解更多详情。