infloxdb和pytest集成插件
influxdb-pytest-plugin的Python项目详细描述
infloxdb pytest插件
pytest插件,用于向“infloxdb”报告测试结果。
目录
- 关于本文档
- 用法
- 示例
- 发送附件
关于本文档
欢迎使用infloxdb pytest插件文档!
此样式指南为使用infloxdb pytest插件的任何人提供了一组编辑指南。
用法
安装
pip install influxdb-pytest-plugin
启动
要使用infloxdb pytest插件运行测试,应提供'-infloxdb pytest'标志。
pytest -sv –influxdb-pytest
将屏幕截图作为附件发送
要将屏幕截图发送到infloxdb,“屏幕截图url”fixture应在如下功能范围内使用:
@pytest.fixture(scope="function")defchrome_driver_init(request,screenshot_url,pytestconfig):chrome_driver=webdriver.Chrome()request.cls.driver=chrome_driveryieldifrequest.node.rep_call.failedandpytestconfig.getoption('--influxdb-pytest'):screenshot_link='URL_EXAMPLE'chrome_driver.save_screenshot(screenshot_link)screenshot_url(screenshot_link)chrome_driver.close()