python包提供Robot框架与Jira测试管理(tm4j)云的集成
tm4j-reporter-robot的Python项目详细描述
项目总结
为TM4J提供了云监听框架Robot。在
安装
如何构建
python setup.py sdist
如何安装
^{pr2}$使用
为了使用Robot框架TM4J监听器,它应该安装到与Robot框架本身相同的PYTHONPATH上。
运行Robot Framework时,将TM4JRobotListener
作为--listener
参数的值,以及访问和项目密钥:
robot --listener tm4j_reporter_robot.TM4JRobotListener:<tm4j_access_key>:<tm4j_project_key>:<tm4j_test_cycle_name> test.robot
Param | Mandatory | Description | Type | Example |
---|---|---|---|---|
tm4j_access_key | Yes | API key to access TM4j. To get it see Instruction | str | |
tm4j_project_key | Yes | Jira / TM4J project prefix without trailing dash | str | QT |
tm4j_test_cycle_name | No | TM4J test cycle name. If not passed, listener will create a new one test cycle with default name "Robot run YYYY-mm-DD HH-MM-SS" | str | My test cycle |
为了监听器向TM4J报告测试执行情况,请使用标记TM4J:<tm4j_test_case_key>
标记Robot测试用例:
My Robot Test Case [Tags] Some tag 1 Some tag 2 TM4J:QT-001 test code goes here
例外情况
TM4J配置异常
如果测试未使用TM4J测试用例键标记,则由侦听器引发:
tm4j_reporter_api.tm4j_exceptions.tm4j_configuration_exceptions.TM4JConfigurationException: Test case key is not found in list of tags. Please mark robot test with tag 'TM4J:<test_case_key>'.
TM4J测试循环描述关键字
库提供了使用特殊关键字Set Tm4j Test Cycle Description
设置TM4J测试周期描述的可能性。在
使用
先导入库,然后使用关键字:
*** Settings *** Library tm4j_reporter_robot.TM4JCycleDescriptor Suite Setup Setting Cycle Description *** Keywords *** Setting Cycle Description Set Tm4j Test Cycle Description My test cycle description
关键字在全局范围内,因此在整个测试执行期间只创建一个实例,并由所有测试用例和测试套件共享。在
- 项目
标签: