doc: add docs for HttpRunner Main Interface

This commit is contained in:
debugtalk
2019-11-02 00:50:50 +08:00
parent 8e4f99438d
commit 6a943eb424
3 changed files with 56 additions and 45 deletions

View File

@@ -6,6 +6,19 @@ from httprunner import (__version__, exceptions, loader, logger, parser,
class HttpRunner(object):
""" Developer Interface: Main Interface
Usage:
from httprunner.api import HttpRunner
runner = HttpRunner(
failfast=True,
save_tests=True,
log_level="INFO",
log_file="test.log"
)
summary = runner.run(path_or_tests)
"""
def __init__(self, failfast=False, save_tests=False, log_level="INFO", log_file=None):
""" initialize HttpRunner.

View File

@@ -280,6 +280,7 @@ def render_html_report(summary, report_template=None, report_dir=None, report_fi
""" render html report with specified report name and template
Args:
summary (dict): test result summary data
report_template (str): specify html report template path, template should be in Jinja2 format.
report_dir (str): specify html report save directory
report_file (str): specify html report file path, this has higher priority than specifying report dir.