基于 pytest ,用于robokit和rdscore的自动化测试的脚本库
rbk_ip 和 rdscore_ip 配置正确。pip install -U pytest
pip install -U pytest-html
在 AutoTest 目录下,通过控制台运行下面的指令:
pytest test_rbk -v --html=report.html --self-contained-html
pytest test_rdscore -v --html=report.html --self-contained-html
最后测试结果在report.html中
APILib 中 rbklib.py 实现了机器人RBK的接口。
APILib 中 orderLib 实现了rdscore的接口。
pytest是 python 的第三方测试框架,是基于 unittest 的扩展框架,比 unittest 更简洁,更高效。使用 pytest 编写用例,必须遵守以下规则:
测试文件名必须以 test_ 开头或者 _test 结尾(如: test_ab.py )
测试方法必须以 test_ 开头。
测试类命名以 Test 开头。