xiaobaiapi 让接口测试起来更简单、人性化、更好玩 公众号:小白科技之窗
Project description
xiaobaiapi
介绍
让接口测试起来更简单、人性化、更好玩
公众号:小白科技之窗
接口测试需要接口的痛点:
- 接口文档的导入:swagger、har、curl
- 接口信息头:支持长字符串
- 接口断言:支持jsonpath与正则断言
- 接口数据:支持jsonpath提取数据
软件架构
python3.* + requests + jmespath + pytest + pytest-HTML
安装教程
-
更新下载源
pip config set global.index-url https://pypi.douban.com/simple
-
安装xiaobaiapi
pip install -U xiaobaiapi
使用说明
from xiaobaiapi.xiaobaiapi import RequestClient
# 断言的案例
RequestClient(method='GET', url='http://127.0.0.1:8000', assertExpression='code', assertValue=200)
# 提取器的案例,提取的值存储在r.variable对象中
r = RequestClient(method='GET', url='http://127.0.0.1:8000/api/gettoken', extractorExpression='data.token', extractorVariable='token')
print(r.variable)
日志
版本 | 信息 |
---|---|
0.1 | 完成单个接口断言及提取器 |
0.1.1 | fix |
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
xiaobaiapi-0.1.1.tar.gz
(15.7 kB
view hashes)
Built Distribution
xiaobaiapi-0.1.1-py3-none-any.whl
(15.9 kB
view hashes)
Close
Hashes for xiaobaiapi-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d25f4a98bd4c7ab621891fedfc14cfce83240401b02fabc0466653ee66fa333 |
|
MD5 | e32a88922554616c510c71dbf67f4180 |
|
BLAKE2b-256 | db53b997c742a73cce065470b04c98e8baeb30678859e8bf4a85d6f490eff2b8 |