mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
refactor testcase layer
This commit is contained in:
@@ -11,9 +11,9 @@
|
||||
json:
|
||||
sign: ${get_sign($user_agent, $device_sn, $os_platform, $app_version)}
|
||||
validate:
|
||||
- "eq": ["status_code", 0]
|
||||
- "len_eq": ["content.token", 12]
|
||||
- "contains": [{"a": 1, "b": 2}, "a"]
|
||||
- eq: ["status_code", 0]
|
||||
- len_eq: ["content.token", 12]
|
||||
- contains: [{"a": 1, "b": 2}, "a"]
|
||||
|
||||
- api:
|
||||
def: create_user($uid, $user_name, $user_password, $token)
|
||||
@@ -25,6 +25,8 @@
|
||||
json:
|
||||
name: $user_name
|
||||
password: $user_password
|
||||
validate:
|
||||
- eq: ["status_code", 201]
|
||||
|
||||
- api:
|
||||
def: get_user($uid, $token)
|
||||
@@ -33,6 +35,8 @@
|
||||
method: GET
|
||||
headers:
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
|
||||
- api:
|
||||
def: update_user($uid, $user_name, $user_password, $token)
|
||||
@@ -44,6 +48,8 @@
|
||||
json:
|
||||
name: $user_name
|
||||
password: $user_password
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
|
||||
- api:
|
||||
def: delete_user($uid, $token)
|
||||
@@ -52,6 +58,8 @@
|
||||
method: DELETE
|
||||
headers:
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
|
||||
- api:
|
||||
def: get_users($token)
|
||||
@@ -60,6 +68,8 @@
|
||||
method: GET
|
||||
headers:
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
|
||||
- api:
|
||||
def: reset_all($token)
|
||||
@@ -68,3 +78,6 @@
|
||||
method: GET
|
||||
headers:
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["content.success", true]
|
||||
Reference in New Issue
Block a user