Package: haf
HAF支持多种测试的高可用测试框架安装使用 pip 直接安装tsbxmw@ps#pipinstallhaf--upgrade使用 git 下载源码安装tsbxmw@ps#gitclonehttps://github.com/tsbxmw/haftsbxmw@ps#cdhaftsbxmw@ps#pythonsetup.pyinstall如何运行例子1，使用init命令 或者git获取源码例子python-mhafinit或者gitclonehttps://github.com/tsbxmw/haf-sample2, 例子提供了api和web-ui的测试用例运行api用例python-mhafrun-c=config.json运行web ui测试用例python-mhafrun-c=config-web.json3, 可以在data文件夹下找到index.html，作为默认的 html 报告使用 `chrome` 或者其他浏览器打开即可。其他内容快速开始例子pypi 主页文档主页开始haf-samplepypidoc插件id插件名称插件版本github 主页1haf api serverhaf webserver2haf sql publishhaf sqlpublish如何运行自定义的用例可以本地运行所以的用例所有的进程在本地模式下都是在本机存在的--bus-server(-bs)参数不适用时便是本地模式修改testcases中的config.json文件，用来运行自己的用例修改log_path和report_path和case_path3 个字段为自己默认的地址，分别为 日志路径、报告路径、用例路径。可以删除config->run->sql_publish字段，如果不需要将数据上传到数据库。{"config":{"name":"test","debug":false,"bus_server_port":8801,"run":{"sql_publish":{"id":1,"sql_name":"upload","publish":true,"host":"192.168.0.200","port":3306,"username":"root","password":"root","database":"haf_publish","protocol":"mysql"},"log":{"log_path":"./data"},"bus":{"only":false,"host":"","port":"","auth_key":""},"report":{"report_path":"./data/report.html","report_template":"base","report_export_path":"email"},"case":[{"case_path":"./testcases/test.xlsx"},{"case_path":"./testcases/test2.json"},{"case_path":"./testcases/test1.xlsx"},{"case_path":"./testcases/test3.yml"}],"runner":{"only":false,"count":4},"loader":{"only":false},"recorder":{"only":false},"web_server":{"host":"","port":"","run":true}}}}可以使用testcases中提供的默认例子创建新的用例创建xlsx/py/json/yaml格式的用例也可以使用haf-sample中的例子运行使用config配置运行 测试python-mhafrun-c=./testcases/config.json使用 参数 运行测试python-mhafrun-case=./testcases/test.xlsx,./testcases/test2.json-ld=./data-rh=true-rod=./data/report.html测试报告如何运行 app-ui 测试用例更改config.json中的report字段，增加report_template子字段， 使用base_app为模板"run":{"type":"app"#changetypetoapp"report":{"report_template":"base_app",#changereport_templatetobase_app"report_path":"./data/report.html"}}运行 web-ui 测试用例更改config.json中的report字段，增加report_template子字段， 使用base_web为模板"run":{"type":"web"#changetypetoweb"report":{"report_template":"base_web",#changereport_templatetobase_web"report_path":"./data/report.html"}}haf 例子https://github.com/hautof/haf-sample其他的命令行参数使用多个 runner 增加运行速度，runner-countpython-mhafrun-rc=4启动 web-server，提供可视化过程，web-serverpython-mhafrun-ws=true只启动loader/runner/bus/recorder中的某个# only loaderpython-mhafrun-ol=true# only buspython-mhafrun-ob=true# only runnerpython-mhafrun-or=true# only recorderpython-mhafrun-ore=true使用自定义的报告模板"report":{"report_template":"base_app"}使用插件将数据发送到 数据库"sql_publish":{"id":1,"sql_name":"upload","publish":true,"host":"192.168.0.200","port":3306,"username":"root","password":"root","database":"haf_publish","protocol":"mysql"}其他支持tsbx#pipinstallhafweb-Upython-mhafweb-ss=root:root@localhost:3306@haf_publish-p=8081默认页面http://localhost:8081/index pagehttp://localhost:8081/indextoday pagehttp://localhost:8081/todayothers support looking at hafweb projectweb api server suportget loader infoshttp://localhost:8888/loaderget runner infoshttp://localhost:8888/runnerget result infoshttp://localhost:8888/resultget report infoshttp://localhost:8888/reporthttp://localhost:8888/report-appFrameWorkDesignDocdoc urlread the docwiki homeQuick StartRelease Noterelease notenew featuresnow support app-ui/web-ui cases and generate reportsupport mysql result publishbased on local test runnerssupport xlsx,json,yml,py casesreport generate with html-templatemulti-processes on different machinesmulti-runnersweb-server support restful api based on flaskonly mode : loader/runner/recorder/webserver/bus/logger support