HTTPRunner 3 用户手册 (1) 安装部署
2020-06-24 本文已影响0人
猫与测试
HttpRunner 使用 Python 开发,它支持Python 3.6+ 和大多数操作系统。
在 GitHub-Actions 上连续测试了 Python 3.6/3.7/3.8
和 macOS/Linux/Windows
的组合。
安装
HttpRunner
已发布到 PyPI
仓库,可以使用 pip
直接安装.
$ pip3 install httprunner
如果要使用最新版本,可以使用 github 仓库的 URL 安装。
$ pip3 install git+https://github.com/httprunner/httprunner.git@master
如果已经安装过,可以使用 -U
进行升级。
$ pip3 install -U httprunner
$ pip3 install -U git+https://github.com/httprunner/httprunner.git@master
检查是否安装成功
如果 HttpRunner 安装成功,有 4 个命令可用:
-
httprunner
: 核心命令,可以使用 HttpRunner 的所有命令 -
hrun
:httprunner run
命令的别名,运行 YAML/JSON/pytest 格式的测试用例 -
hmake
:httprunner make
命令的别名,将 YAML/JSON 格式的 testcases 转换成 pytest 格式的测试用例 -
har2case
:httprunner har2case
命令的别名,将 HAR 文件转换为 YAML/JSON 格式的测试用例
查看 HttpRunner
版本:
$ httprunner -V # hrun -V
3.1.0
查看所有可用的命令:
$ httprunner -h
usage: httprunner [-h] [-V] {run,startproject,har2case,make} ...
One-stop solution for HTTP(S) testing.
positional arguments:
{run,startproject,har2case,make}
sub-command help
run Make HttpRunner testcases and run with pytest.
startproject Create a new project with template structure.
har2case Convert HAR(HTTP Archive) to YAML/JSON testcases for
HttpRunner.
make Convert YAML/JSON testcases to pytest cases.
optional arguments:
-h, --help show this help message and exit
-V, --version show version