mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-08 21:51:43 +08:00
fix: pass output variables between testcases
This commit is contained in:
39
tests/testcases/deps/check_and_create.yml
Normal file
39
tests/testcases/deps/check_and_create.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
- config:
|
||||
name: "create user and check result."
|
||||
id: create_and_check
|
||||
base_url: "http://127.0.0.1:5000"
|
||||
variables:
|
||||
uid: 9001
|
||||
device_sn: "TESTCASE_CREATE_XXX"
|
||||
|
||||
- test:
|
||||
name: make sure user $uid does not exist
|
||||
api: api/get_user.yml
|
||||
variables:
|
||||
uid: $uid
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 404]
|
||||
- eq: ["content.success", false]
|
||||
|
||||
- test:
|
||||
name: create user $uid for $device_sn
|
||||
api: api/create_user.yml
|
||||
variables:
|
||||
user_name: "user1"
|
||||
user_password: "123456"
|
||||
uid: $uid
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 201]
|
||||
- eq: ["content.success", true]
|
||||
|
||||
- test:
|
||||
name: check if user $uid exists
|
||||
api: api/get_user.yml
|
||||
variables:
|
||||
uid: $uid
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["content.success", true]
|
||||
Reference in New Issue
Block a user