-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何实现接口之间参数的关联? #3
Comments
这个功能是已经有了的。例如下面的形式,通过 - 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"} |
非常感谢分享,收获很多
|
@chaoedu 欢迎使用。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
登录过程中获取的token,可以在之后的testcase中使用
The text was updated successfully, but these errors were encountered: