httpRunner安裝(預設翻譯官方文件,建議先看官方文件)
阿新 • • 發佈:2020-08-10
安裝
httpRunner使用的是python開發的,建議使用3.6及以上的版本,目前使用了3.6,3.7,3.9在window/Linux/macos進行了測試,均可以正常使用
httpRunner託管在PyPi上,在使用之前建議安裝好pip
使用pip命令安裝:
pip3 install httprunner
|
如果,受制於國內的網路,可以使用aliyun的pip映象源
如果,想使用最新的版本,可以使用GitHub上的url進行安裝:
pip3 install git + https: / / github.com / httprunner / httprunner.git@master |
如果,之前安裝過,可以使用httprunner -U升級到最新版本
pip3 install - U httprunner
pip3 install - U git + https: / / github.com / httprunner / httprunner.git@master
|
檢查安裝
安裝完成之後,在系統中將多出以下命令:
httprunner:主命令,用於所有函式
hrun:用於執行yaml/json/pytest測試用例
hmake:用於將yaml/json格式的測試用例轉成pytest格式的測試用例
har2case:用於將har包轉成yaml/json格式的測試用例
locusts:執行locusts用於效能測試
檢視版本:
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
|