本文主要是介绍2、httprunner常用命令,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、初始化脚手架
httprunner startproject 项目名称
2、转化har文件为yml/json/pytest
默认转化为pytest
har2case 文件路径/文件
转化为yml
har2case 文件路径/文件 -2y
转化为json
har2case 文件路径/文件 -2j
3、转化yml/json为py文件(pytest)
hmake yml/json文件名
4、运行yml/json/pytest文件
hrun yml/json/pytest文件名
运行yml、json会自动生成对应的pytest文件(其实就是以pytest文件的方式运行)
5、生成报告
生成pytest-html报告
hrun yml/json/pytest文件名 --html=reports/report.html
生成allure报告
一、生成运行的缓存文件
hrun yml/json/pytest文件名 --alluredir=../reports/
二、根据运行的缓存文件生成allure报告
allure generate ../reports/ -o ../reports/
这篇关于2、httprunner常用命令的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!