Comments (3)
这个功能是已经有了的。例如下面的形式,通过extract_binds
将token提取出来并保存到user_token
,然后后续的请求都可以直接用了。
- test:
name: login with email to get user token
request:
url: /apis/apprest/v1/email_login
method: POST
headers:
Content-Type: application/x-www-form-urlencoded
data:
email: $user_email
password: $user_passwd
extract_binds:
user_token: content.data.token
validators:
- {"check": "status_code", "expected": 200}
- {"check": "headers.content-type", "expected": "application/json;charset=UTF-8"}
- {"check": "content.code", "expected": 0}
- {"check": "content.message", "expected": "ok"}
- test:
name: /api/users/user_id/home
request:
url: /api/users/$user_id/home
params:
page: 1
page_size: 21
token: $user_token
method: GET
validators:
- {"check": "status_code", "expected": 200}
- {"check": "headers.content-type", "expected": "application/json; charset=utf-8"}
- {"check": "content.status", "expected": 0}
- {"check": "content.status_msg", "expected": "ok"}
- {"check": "content.items", "expected": 10, "comparator": "len_gt"}
from httprunner.
from httprunner.
@chaoedu 欢迎使用。
from httprunner.
Related Issues (20)
- validate 失败后report无法正常生成 HOT 9
- 最新版本 v4.3.6为什么没有上传到pypi呢? HOT 1
- Error: init plugin failed: connect grpc plugin failed: Unrecognized remote plugin message HOT 2
- validate自定义函数校验失败时,report内容缺失
- log日志巨大,有什么解决思路吗? HOT 1
- 执行带 setupHooks 和 teardownHooks 的json用例时报错了,提示:[ERROR] fungo: exec command failed: error="exit status 9009" stderr=""
- 执行测试用例结束出现invalid memory address or nil pointer dereference [recovered]
- macOS安装完4.3.6后脚手架创建项目报错/Users/minxiao/.hrp/venv/bin/python3: No module named pip
- yml 文件里 的url结尾没有 “/”,但是在 看发起的请求和log 中 url 的结尾有 “/”,导致接口 404。 HOT 2
- When the assertion fails, an error message is generated, and a test report is not generated HOT 1
- 参数化驱动用例,用例名引用变量失败 HOT 1
- 执行hrp用例的时候,偶发的报python编译错误
- 使用低于v.4.3.3版本的hrp没办法生成报告
- 感觉hrp4基于go语言的版本不好集成到测试平台
- 使用4.3.6 转化har文件失败 HOT 2
- 运行的任务比较多时会发生错误
- 接口关联后${variable}引用为空
- hrp run *.yaml 默认把headers的参数的首字母大写
- hrun运行的时候希望能够支持不同的环境env, 实现多个环境便捷切换。
- 期望实现对数据库的测试校验,通过查询数据库的值和接口返回结果做比对验证。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httprunner.