automateRunner
组合各种测试工具,包括 requests ,appium ,以page
项目地址:
https://gitlab.com/testerhomee/hogwarts/automaterunner
环境配置
- python3+
- 安装项目下的 requirements.txt 依赖包
使用
通过 yaml 数据,实现配置数据驱动,比如下面例子:
depend: ['requests', 'json']
get_token:
run_request:
- method: get
url: https://qyapi.weixin.qq.com/cgi-bin/gettoken
params:
corpid: wwd6da61649bd66fea
corpsecret: C7uGOrNyxWWzwBsUyWEbLUlJOWjU7Qw5ORPxemPKw6w
return: ${run_request}
执行结果:
<Response [200]>
- depend:导入依赖,相当于 python 的 import ,这里导入了 requests 和 json 依赖
- get_token:定义函数,函数内容如下
- run_requests:automateRunner 会自动识别以 run_ 开头的 key ,并执行这个函数,比如 run_request 会执行 request 函数,函数参数如下:
method: get
url: xxx
params:
corpid: xxx
corpsecret: xxx
- return: 定义返回内容,如果是 ${run_request} ,代表返回 run_request 的执行结果