Changelogs » Haf

Haf

2.9.3

- fix 168

2.9.2

- support case reuse by other case

> example of reuse case: using 1.1.test1.response.body.data.name

1, using <begin> <end>  to make haf find the tag
json
<begin>{'type':'int','case':'1.1.test1','property':{'1':'api_response','2':'body','3':'data','4':'name'}}<end>

2, type is the target type, case is the target case, property ordered by the number 1,2,3,4...., haf would find the target by the number
3, add dependent_var and dependent to the case
- add GET/POST/PUT to the console output of http-request

2.9.0

- fix bugs:
1, filter_case -fc error
2, fix http_request by reqeusts's session
- support sql server tool
- add using_data to get method
- change default log level to debug, on linux system always run failed of no debug output

2.8.8

- fix one bug of urllib.urlopen 's request
- when using get method:

1, if u want to using data as url, just not using `using_data` in kwargs

python
Util.http_request(request)


2, if u want to using data as get's body, using `using_data` is nessary in `http_request`

python
Util.http_request(request, using_data=True)

2.8.7

- fix pyrunner bugs: must update from 2.8.5/2.8.6 160
- update readme
- add debug output of lock

2.8.4

- fix some bugs of -nout -llog -debug
- make runner faster than before at linux/unix platform
- add docs to py files

2.8.2

- support new cmd prams

- nout                         - no output
- filter-case                - filter cases to run
- local-logger llog     - local logger make haf faster

2.8.0

- add `-no-output` support (-nout=true)
- add jenkinsfile test of `nout`
- make sub log to one dir of test-name
- fix some bugs

2.7.7

- add pluginmanager
python
import itertools
import random

import pluggy
import json
import os
import sys
import argparse
from haf import hookspecs, lib


class PluginManager(object):
def __init__(self):
self.get_plugin_manager()

def add_options(self, sub_run_arg_program):
pm = self.pm
return pm.hook.add_option(parse = sub_run_arg_program)

def load_from_file(self, file_name):
pm = self.pm
inputs = pm.hook.load_from_file(file_name = file_name)
if isinstance(inputs, list):
return inputs[0]
elif isinstance(inputs, dict):
return inputs

def publish_to_sql(self, args, results):
pm = self.pm
publish_result = pm.hook.publish_to_sql(args=args, results=results)
return publish_result

def start_web_server(self, args, bus_client):
pm = self.pm
result = pm.hook.start_web_server(args=args, bus_client=bus_client)
return result

def get_plugin_manager(self):
self.pm = pluggy.PluginManager("haf")
self.pm.add_hookspecs(hookspecs)
self.pm.load_setuptools_entrypoints("haf")
self.pm.register(lib)
return self.pm


plugin_manager = PluginManager()


- add hookspecs support
python
import pluggy


hookspec = pluggy.HookspecMarker("haf")


hookspec
def add_option(parse):
"""add option to parse

:param run args
:return: None
"""


hookspec
def load_from_file(file_name):
"""add option to parse

:param run args
:return: file_name
"""


hookspec
def publish_to_sql(args, results):
"""publish result to sql

:param publish : or not
:param result : publish result
:return : None
"""

hookspec
def start_web_server(args, bus_client):
"""start web server

:param args:
:return:
"""

- update sqlpublish and apiserver to new plugin mode

2.7.5

- remove local Lock
- using mutiprocessing's Lock to make runner faster
- fix some bugs of lossing case 29
- fix not stop runner issue

2.7.1

add issue template
update readme and docs and pngs
update stage design:
> support stage-result
> include app and web stage
add py bench support
add case reuse try : TODO
add redistool to database

2.7.0

- warning support
![image](https://user-images.githubusercontent.com/15834891/54604394-99052a80-4a81-11e9-9279-c498a4644323.png)

- stage result show
![image](https://user-images.githubusercontent.com/15834891/54604436-ae7a5480-4a81-11e9-8c72-f8951befd7cb.png)

- fix some bugs:

> operation show of web stages would be ok
> can failed stage : to be warning but not error
> error should be fail when stage run

2.6.6

- fix logger bugs
- add console summary output

2.6.3

> add jsonschema to check config.json file when test start

> using build.bat to build exe

shell
xcopy /e /a /y ..\haf\* .\
pyinstaller -F main.py -i ..\docs\png\haf.ico --additional-hooks-dir=


> add new locker support

python
contextlib.contextmanager
def new_locker(bus_client, key):
locker = Locker(bus_client, key)
locker.get_lock()
try:
yield
finally:
locker.release_lock()
return

2.6.2

- support selenium web ui case now
- using python -m haf init to get test_web case
- using python -m haf run -c=config-web.json to run test_web case

- haf-sample : https://github.com/hautof/haf-sample/blob/master/test_web.json

json
{
"testcases": [
{
"id": 1,
"name": "test baidu",
"subid": 1,
"subname": "default",
"app_name": "default",
"run": true,
"type": "web",
"wait_time": 2,
"desired_caps": {
"platformName": "chrome",
"platformVersion": "9",
"start_url": "http://baidu.com"
},
"stage": [
{
"id": 1,
"name": "输入搜索内容",
"operation": "send_keys",
"path": {
"xpath": "//*[id='kw']"
},
"try": false,
"info": {"keys": "autotest.wang"},
"sleep": 0.5
},
{
"id": 2,
"name": "点击搜索按钮",
"operation": "click",
"path": {
"xpath": "//*[id='su']"
},
"try": false,
"info": null,
"sleep": 0.5
}
],
"dependent": null
}],
"dbconfig": [{
"id": 1,
"sql_name": "mysql1",
"protocol": "mysql",
"host": "192.168.41.208",
"port": 3306,
"username": "root",
"password": "testzhan123",
"database": "visual"
}],
"config": [{
"name": "test_baidu",
"benchname": "test_baidu",
"protocol": "http",
"host_port": "www.baidu.com"
}]
}

2.6.1

- change to plugin mode : sql publish and api server
- fix some bugs of --bus-server-port (-bsp)
- add support of app case publish to sql

2.4.3

- fix some bugs
- update app runner / report

2.3.3

- add android app ui case support
- add app ui html report template

> AppRunner
- same as PyRunner & ApiRunner

> apphelper
- BasePage : base function of app ui
- Stage : stage of ui
- DesiredCaps : appium desired caps

> stage support
![image](https://user-images.githubusercontent.com/15834891/52685375-74023100-2f84-11e9-9bcb-5e4990cc9460.png)

2.2.4

- support mysql publish
- publish results to mysql


"sql_publish": {
"id": 1,
"sql_name": "upload",
"publish": true,
"host": "192.168.41.208",
"port": 3306,
"username": "root",
"password": "testzhan123",
"database": "haf_publish",
"protocol": "mysql"
}


![image](https://user-images.githubusercontent.com/15834891/51518119-d66d8300-1e57-11e9-9554-22503b02f946.png)

2.2.0


      

2.2.0rc0


      

2.2.a


      

2.1.9rc0


      

2.1.7

- main loop command support
- fix some bugs

2.1.0

- bug fix : end time and duration time
- contains version 2.0.7 2.0.8 2.0.9 ...

2.1.c

- fix some bugs
- add some new features

2.0.7

- fix some bug
- add /doc /status / support
- fix autotest.wang gif/png
- design.md png show

2.0.5


      

2.0.4

- update html with online template
- add debug support

2.0.3

- update lock support to decorator
python
from haf.utils import locker
lock
def lock_func():
pass

- support pycase
python
from haf.mark import test, skip, parameterize
test
skip
parameterize([{}])

2.0.1

- bug fix : cannot show png at readme
- add gif to doc/show

2.0.0

- based on local test runner

- support xlsx,json,yml,py cases

- report generate with html-template

- multi-processes on different machines

- multi-runners

- web-server support restful api based on flask

- only mode : loader/runner/recorder/webserver/bus support

0.0.9

- make the plugin mode

0.0.8

- make plugin manager mode
- add hooks to support add_option and so on