根据此处的文档,我尝试使用以下输入导入我的 JUnit 样式 XML。curl -H "Content-Type:multipart/form-data" -u mylogin:mypassword -F "file=@output.xml" https://jira.nayax.com/rest/raven/1.0/import/execution/junit ?projectKey=TGP&testPlanKey=TGP-25
我使用这篇文章使用 XSL 将我的 JMeter XML 输出转换为 JUnit 格式。输出是:
输出.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite>
<testcase classname="httpSample" name="Set-up Thread: loginUsingPOST - Success"
time="0.789">
<failure/>
</testcase>
<testcase classname="httpSample" name="Set-up Thread: loginUsingPOST - Success"
time="0.631">
<failure/>
</testcase>
<testcase classname="httpSample" name="createNfcTagUsingPOST - Success" time="0.282">
<failure/>
</testcase>
<testcase classname="httpSample" name="handleTagDetectionUsingPOST - Success"
time="0.311">
<failure>Test failed: code expected to equal /
****** received : [[[403]]]
****** comparison: [[[200]]]
/</failure>
</testcase>
</testsuite>
</testsuites>
输出是:
{"error":"Error assembling issue data: Field \u0027customfield_11033\u0027 cannot be set. It is not on the appropriate screen, or unknown."}
当我在浏览器的源代码视图中查看测试时,该字段被隐藏:
<input type="hidden" name="raven-testexec-test-customFieldId"
id="raven-testexec-test-customFieldId" value="customfield_11033"/>
<input type="hidden" name="raven-testexec-test-customFieldEnv"
id="raven-testexec-test-customFieldEnv" value="14440"/>
<input type="hidden" name="raven-testexec-test-revisionId"
id="raven-testexec-test-revisionId" value="customfield_14437"/>
<input type="hidden" name="raven-testexec-test-sprintId"
id="raven-testexec-test-sprintId" value="customfield_10105"/>
所以它看起来像customfield_11033
被映射到这个名为 的通用事物customFieldId
,就像(例如)customfield_10105
被映射到sprintId
.
所以这是什么customFieldId
??
当我在源代码视图中查看测试执行并搜索时11033
,我根本没有找到它。
其他尝试
我在 XRay 的文档站点上读到可以使用multipart
各种 API,但我得到了相同的结果。
curl -H "Content-Type:multipart/form-data" -u login:password -F "file=@output.xml" -F "testInfo=@test_info.json" -F "info=@test_exec_info.json" https://jira.nayax.com/rest/raven/1.0/import/execution/junit/multipart
test_exec_info.json
{
"fields": {
"project": {
"id": "12900",
"key": "TGP"
},
"summary": "Test Execution for JMeter Execution"
}
}
test_info.json
{
"fields": {
"description": "Game Activation"
}
}
这是一个测试问题的屏幕截图
这是项目中测试执行的屏幕截图
我没有 Jira 布局的管理员权限。Jira 管理员公开此自定义字段以使我的导入正常工作是必要条件吗?