英文:
Xray importToSameExecution not working for Cypress Cucumber JSON in Jenkins Pipeline
问题
我正试图将Cypress Cucumber JSON结果导入到同一个Xray执行中,使用Jenkins管道中的 "Xray - Test Management for Jira Plugin"。但在每次运行中,Xray都会创建一个新的执行。
Jenkins Pipeline
stage('上传Xray测试结果') {
step([$class: 'XrayImportBuilder', endpointName: '/cucumber', projectKey: 'SPT', testPlanKey: '3081', testExecKey: 'SPT-3082', importToSameExecution: 'true', importFilePath: 'jsonlogs/log.json', importInParallel: 'false', serverInstance: '<<serverInstance>>'])
};
Xray测试执行
Jenkins控制台日志
此外,我已将执行ID添加为我的功能文件的顶级标签。
英文:
I'm trying to import Cypress Cucumber JSON results into same Xray execution using "Xray - Test Management for Jira Plugin" in Jenkins pipeline. But in each run Xray is creating a new execution.
Jenkins Pipeline
stage('Upload xray test results') {
step([$class: 'XrayImportBuilder', endpointName: '/cucumber', projectKey: 'SPT', testPlanKey: '3081', testExecKey : 'SPT-3082', importToSameExecution: 'true', importFilePath: 'jsonlogs/log.json', importInParallel: 'false', serverInstance: '<<serverInstance>>'])
};
Xray Test Execution
Jenkins Console Log
Also I've added Execution ID as a tag in my feature file top level
答案1
得分: 1
由于历史原因,相关的cucumber API端点与其他端点(即其他报告格式)略有不同,它不允许您指定测试执行问题关键字,只允许您指定报告文件本身。因此,您在共享的管道语法中提到的那些参数是无效的。
但是,更新现有的测试执行是可能的。黄瓜JSON报告需要将测试执行问题关键字添加为标签。为此,在“Feature:”部分之前,紧挨着与您的“requirement”相关的标签旁边添加测试执行问题关键字标签。假设现有的测试执行问题关键字是SPT-1000,那么您的功能应该如下所示:
@SPT-1000 @REQ_SPT-3082
Feature: xxx
@TEST_SPT-2882
Scenario: yyy
每当您运行这个测试时,黄瓜JSON将包含对它的引用,然后每当您导入时,Xray将知道它需要更新现有的测试执行。
顺便提一下:如果您使用黄瓜多部分端点,它将始终创建一个新的测试执行问题。
提供的链接适用于Xray服务器/DC,但即使Xray云使用不同的API,它仍然使用相同的逻辑。
英文:
For historical reasons, the related cucumber API endpoint is a bit different from other ones (i.e., for other report formats), in the sense that it doesn't allow you to specify the Test Execution issue key.. just the report file itself. Thus, those arguments on the pipeline syntax you shared are worthless.
It's possible to update an existing Test Execution though. The cucumber JSON report needs to have the Test Execution issue key as a tag. To have it, add the Test Execution issue key as a tag before the "Feature: " section, right next to the tag where you have the reference to your "requirement".
Let's say the existing Test Execution issue key is SPT-1000, then your feature needs to be something like:
@SPT-1000 @REQ_SPT-3082
Feature: xxx
@TEST_SPT-2882
Scenario: yyy
Whenever you run this, the cucumber json will contain the reference to it.. and then whenever you import, Xray will know that it needs to update an existing Test Execution.
Side note: if you use the cucumber multipart endpoint, it will always create a new Test Execution issue though.
The provided link is for Xray server/DC, but even Xray cloud which has a different API, still uses the same logic.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论