首页 > 解决方案 > Zephyr scale 服务器:通过自动化 API 将测试结果上传到 Zephyr Scale

问题描述

我正在使用 Zepyhr Scale Server,我想将使用 pytest 制作的自动化测试套件的结果上传到 Zephyr。我试过这个 POST 请求:

post(url="https://{my-jira-host}/rest/atm/1.0/automation/execution/{projectKey}", auth=({my_username}, {my_password}), files={"file":open("test_results.zip","rb")})

但它不起作用,因为响应是“errorMessages”:[“无效的自定义格式 JSON 文件”]}。

我正在上传一个 zip 文件,其中包含一个使用生成的 xml 文件

pytest --junitxml=output/junitxml_report.xml 在这里解释https://support.smartbear.com/zephyr-scale-cloud/docs/test-automation/pytest-integration.html

我尝试使用 API 客户端(邮递员)发出相同的请求,但错误是“无效的 ZIP 文件”,即使我使用错误的用户名未能通过身份验证,或者即使我只上传了 xml 文件。

也许有人会做同样的事情并可以帮助我?我是新手:) 谢谢!

标签: pytestjira-zephyr

解决方案


推荐阅读