python-3.x 如何将测试结果从unittest添加到testrail?

arknldoa  于 4个月前  发布在  Python
关注(0)|答案(1)|浏览(74)

我用python+unittest+appium做了一些测试ios的测试。如果不描述如何在每个测试中添加结果,我怎么能把它们的结果添加到testrail中呢?
举例说明:

def test_a(self):
        """test A"""
        if self.assertNotEqual(1, 1):
            api.results.add_result_for_case(run_id=self.id_test_run, case_id=123, status_id=1)
        else:
            api.results.add_result_for_case(run_id=self.id_test_run, case_id=123, status_id=5)

字符串

csga3l58

csga3l581#

通过使用TestRail CLI可以最有效地实现这一目标。TestRail CLI用作命令行界面工具,可以将测试自动化结果从任何JUnit风格的XML文件无缝上传到TestRail。
通过遵循代码优先的方法,您可以根据指定的输入上传测试结果。此过程在TestRail上选择的指定项目中创建新的测试运行。
有关更多信息,请访问以下链接,参阅TestRail CLI的官方文档:https://support.testrail.com/hc/en-us/articles/12609674354068-Automation-workflows-Code-first

相关问题