我们使用 Xray 进行测试用例管理,并且自动化了一些测试用例。我们使用 jenkins 执行自动化测试用例,并使用插件读取结果 xml 文件并更新测试运行。但是,对于每个自动化测试用例,它都会创建一个新的 Xray 测试用例。有没有办法将每个自动化测试用例映射到测试执行中的现有测试用例?
问问题
938 次
2 回答
1
将自动化结果映射到特定现有测试问题的能力取决于您使用的报告格式,如以下链接中所述。
https://confluence.xpand-it.com/display/XRAY/Integrating+with+Testing+Frameworks
例如,使用 JUnit,您不能强制使用特定的 @Test 注释方法来对应现有的测试问题(由于 JUnit XML 报告格式的限制)。但是,如果您使用 TestNG、NUnit 或 Robot 框架,这是可能的,如以下教程所示:
- https://confluence.xpand-it.com/display/XRAY/Testing+using+TestNG+in+Java?src=contextnavpagetreemode
- https://confluence.xpand-it.com/pages/viewpage.action?pageId=62269682&src=contextnavpagetreemode
- https://confluence.xpand-it.com/display/XRAY/Testing+using+Robot+Framework+integration+in+Python+or+Java?src=contextnavpagetreemode
最后,如果您使用 Xray JSON 格式,您还可以将结果报告回现有的测试问题。更多关于这里
Xray JSON 报告的示例类似于
{
"testExecutionKey": "DEMO-1206",
"info" : {
"summary" : "Execution of automated tests for release v1.3",
"description" : "This execution is automatically created when importing execution results from an external source",
"version" : "v1.3",
"user" : "admin",
"revision" : "1.0.42134",
"startDate" : "2014-08-30T11:47:35+01:00",
"finishDate" : "2014-08-30T11:53:00+01:00",
"testPlanKey" : "DEMO-100"
},
"tests" : [
{
"testKey" : "DEMO-6",
"start" : "2014-08-30T11:47:35+01:00",
"finish" : "2014-08-30T11:50:56+01:00",
"comment" : "Successful execution",
"status" : "PASS"
}
]
}
于 2020-07-31T13:20:02.210 回答
0
您创建的测试用例很可能不是通用的,而是手动类型的。查看由自动化作业创建的测试的测试定义。这个定义必须复制到实际的测试用例中,但同样,它们需要是通用的。
于 2019-02-08T18:58:22.627 回答