httprunner Chinese manual: https: //cn.httprunner.org/
Mounting
Usepip
the installation.
pip install httprunner
need the latest development version, you can use GitHub project of installing warehouse address:
$ pip install git+https://github.com/HttpRunner/HttpRunner.git@master
If you have previously installed a HttpRunner, now we need to upgrade to the latest version, you can use -U
parameters.
$ pip install -U HttpRunner $ pip install -U git+https://github.com/HttpRunner/HttpRunner.git@master
Installation check
Run the following command, if the version number is displayed correctly, then HttpRunner successful installation.
$ Crashes V 2.0.2 $ har2case V 0.2.0
Developer mode
HttpRunner need to develop debugging (debug), then you need the following steps.
HttpRunner use pipenv to manage dependencies, if you do not pipenv installed, you need to execute the following command follow:
$ Pip install pipenv
get HttpRunner Source:
$ Git clone https://github.com/HttpRunner/HttpRunner.git
into the repository directory, and install any dependencies:
$ Pipenv install --dev
run unit tests, if the tests are passed, then the normal environment.
$ pipenv run python -m unittest discover
(A problem!)
View HttpRunner situation of dependence:
$ pipenv graph
Start Service
In httprunner developers have already written case files, stored in the unit test directory HttpRunner, the path for the tests / api_server.py
You can use this case to file Demo, using flask application service starts
pip install Flask-Script
set FLASK_APP=tests/api_server.py
flask run
debug mode in a closed state, set the environment variable
set FLASK_ENV=development
Run flask run again