graphql & restful / http(s) tools
Project description
前置
- 安装allure并配置好环境变量
- 项目根目录新建 hooks.py 实现动态扩展函数
- 编写测试文件代码
- 执行测试
作用
graphql, restful HTTP/HTTPS 接口测试工具,需要编写代码
example
# testcase.py
from gruntest.grunner import Grunner
from gruntest.schemas import Config, TestStep, RequestSchema
class TestRunner(Grunner):
config = Config(
base_header={"Host": "49.232.203.244:1339"}
)
steps = [
TestStep(
name='百度',
request=RequestSchema(
url='http://www.httpbin.org/get',
method='get',
headers={"token": "123"},
params={"limit": 5, "page": 1}
),
extra={"code": "$.args.limit"}
),
TestStep(
name='百度',
request=RequestSchema(
url='http://www.httpbin.org/get',
method='get',
headers={"token": "123"},
params={"limit": 5, "page": "${sum2('$code')}"}
),
extra={"code": "$.args.limit"},
expect={"$.code": "code"}
)
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gruntest-0.1.1.tar.gz
(6.2 kB
view hashes)