jiakecong

前言

受益于pytest的集成,HttpRunner v3.x可以使用pytest所有插件,包括pytest-htmlallure-pytest,也可以实现这2种方式的报告
 

内置html报告

pytest-html插件随HttpRunner一期安装。当你运行测试用例想生成html报告时,可以在命令行中添加--html
安装Httprunner时,pytest-html插件也会随之安装,当运行测试用例的时候,想生成html形式的报告,可以在命令行中添加--html + 报告路径

$ hrun /path/to/testcase --html=report.html

举例:在当前目录执行testcases下的所有用例,并在当前目录下的report目录下,生成名为test_report.html的报告

(httprunner_env) ➜  hrun_demo hrun testcases --html=reports/test_report.html                                
2021-02-10 11:24:21.055 | INFO     | httprunner.make:__make:512 - make path: /Users/jkc/hrun/hrun_demo/testcases
2021-02-10 11:24:21.057 | INFO     | httprunner.make:format_pytest_with_black:170 - format pytest cases with black ...
No Path provided. Nothing to do 

相关文章:

  • 2021-04-07
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2021-02-09
  • 2021-12-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2021-10-02
  • 2022-02-13
  • 2022-02-21
相关资源
相似解决方案