用于创建testrail运行和添加结果的pytest插件

pytest-testrail的Python项目详细描述


Build StatusPyPI version

这是一个pytest插件,用于创建/编辑基于 在pytest标记上。将更新收集的测试结果 针对testrail中的testplan/testrun。

安装

pip install pytest-testrail

配置

pytest测试的配置

将一个标记添加到将被选取以添加到运行中的测试。

frompytest_testrail.pluginimporttestrail@testrail('C1234','C5678')deftest_foo():# test code goes here# ORfrompytest_testrail.pluginimportpytestrail@pytestrail.case('C1234','C5678')deftest_bar():# test code goes here

more detailed example here

testrail的配置

  • 设置文件模板配置:
[API]url=https://yoururl.testrail.net/email=user@email.compassword=<api_key>[TESTRUN]assignedto_id=1project_id=2suite_id=3

  • 设置命令行选项(见下文)

用法

基本上,下面的命令将在testrail中创建一个testrun,add 所有标记为要运行的测试。所有测试完成后 在TestRail中更新:

py.test --testrail --tr-config=<settings file>.cfg

所有可用选项

--testrail            Create and update testruns with TestRail
--tr-config=TR_CONFIG
                      Path to the config file containing information about
                      the TestRail server (defaults to testrail.cfg)
--tr-url=TR_URL       TestRail address you use to access TestRail with your
                      web browser (config file: url in API section)
--tr-email=TR_EMAIL   Email for the account on the TestRail server (config
                      file: email in API section)
--tr-password=TR_PASSWORD
                      Password for the account on the TestRail server
                      (config file: password in API section)
--tr-testrun-assignedto-id=TR_TESTRUN_ASSIGNEDTO_ID
                      ID of the user assigned to the test run (config file:
                      assignedto_id in TESTRUN section)
--tr-testrun-project-id=TR_TESTRUN_PROJECT_ID
                      ID of the project the test run is in (config file:
                      project_id in TESTRUN section)
--tr-testrun-suite-id=TR_TESTRUN_SUITE_ID
                      ID of the test suite containing the test cases (config
                      file: suite_id in TESTRUN section)
--tr-testrun-suite-include-all
                      Include all test cases in specified test suite when
                      creating test run (config file: include_all in TESTRUN
                      section)
--tr-testrun-name=TR_TESTRUN_NAME
                      Name given to testrun, that appears in TestRail
                      (config file: name in TESTRUN section)
--tr-run-id=TR_RUN_ID
                      Identifier of testrun, that appears in TestRail. If
                      provided, option "--tr-testrun-name" will be ignored
--tr-plan-id=TR_PLAN_ID
                      Identifier of testplan, that appears in TestRail. If
                      provided, option "--tr-testrun-name" will be ignored
--tr-version=TR_VERSION
                      Indicate a version in Test Case result.
--tr-no-ssl-cert-check
                      Do not check for valid SSL certificate on TestRail
                      host
--tr-close-on-complete
                      Close a test plan or test run on completion.
--tr-dont-publish-blocked
                      Do not publish results of "blocked" testcases in
                      TestRail
--tr-skip-missing     Skip test cases that are not present in testrun

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何使用Java中的扫描仪读取文本文件中的特定字符?   java如果我们在hibernate中开始事务但不提交它,会发生什么?   Azure CosmosDB Java Springboot中的无服务器帐户不支持spring boot设置提供吞吐量或容器自动导航   附加到新对象的Java注释?   java如何将自定义文本视图添加到。在Kotlin中添加通知操作   java Shibboleth添加_OpenSAMLcookies,导致HTTP头大小>8k   分布式传感器数据(~40Hz)的高效Java观测器设计   java如何在while循环外声明数组,但在while循环中初始化它?   用@XmlElementRef注释的java元素没有显示在JAXB编组字符串中?   java替换二维数组的值   java如何在任务栏上创建Windows7加载栏   java如何在组件注释bean中使用会话或RequestScope bean?   java netbeans freermarker插件错误:在实现版本中请求netbeans桥的插件Lexer   java谷歌地图方向。加载失败,返回服务器错误   java当我试图递归地计算两个值之间的整数之和时,为什么结果返回一个奇怪的值?   java如何通过html文件的用户获取运行时输入,以使用Jsoup进行解析?