validate: set expect as alias for expected

This commit is contained in:
debugtalk
2017-11-13 20:56:46 +08:00
parent 40651e5164
commit 3af67a31cc
16 changed files with 117 additions and 114 deletions

View File

@@ -22,8 +22,8 @@
}
],
"validate": [
{"check": "status_code", "comparator": "eq", "expected": 200},
{"check": "content.token", "comparator": "len_eq", "expected": 16}
{"check": "status_code", "comparator": "eq", "expect": 200},
{"check": "content.token", "comparator": "len_eq", "expect": 16}
]
}
},
@@ -44,8 +44,8 @@
}
},
"validate": [
{"check": "status_code", "comparator": "eq", "expected": 201},
{"check": "content.success", "comparator": "eq", "expected": true}
{"check": "status_code", "comparator": "eq", "expect": 201},
{"check": "content.success", "comparator": "eq", "expect": true}
]
}
},
@@ -66,8 +66,8 @@
}
},
"validate": [
{"check": "status_code", "comparator": "eq", "expected": 500},
{"check": "content.success", "comparator": "eq", "expected": false}
{"check": "status_code", "comparator": "eq", "expect": 500},
{"check": "content.success", "comparator": "eq", "expect": false}
]
}
}

View File

@@ -14,8 +14,8 @@
extract:
- token: content.token
validate:
- {"check": "status_code", "comparator": "eq", "expected": 200}
- {"check": "content.token", "comparator": "len_eq", "expected": 16}
- {"check": "status_code", "comparator": "eq", "expect": 200}
- {"check": "content.token", "comparator": "len_eq", "expect": 16}
- test:
name: create user which does not exist
@@ -30,8 +30,8 @@
name: "user1"
password: "123456"
validate:
- {"check": "status_code", "comparator": "eq", "expected": 201}
- {"check": "content.success", "comparator": "eq", "expected": true}
- {"check": "status_code", "comparator": "eq", "expect": 201}
- {"check": "content.success", "comparator": "eq", "expect": true}
- test:
name: create user which existed
@@ -46,5 +46,5 @@
name: "user1"
password: "123456"
validate:
- {"check": "status_code", "comparator": "eq", "expected": 500}
- {"check": "content.success", "comparator": "eq", "expected": false}
- {"check": "status_code", "comparator": "eq", "expect": 500}
- {"check": "content.success", "comparator": "eq", "expect": false}

View File

@@ -23,15 +23,15 @@
name: reset all users
api: reset_all($token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.success", "expected": true}
- {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true}
- test:
name: get user that does not exist
api: get_user(1000, $token)
validate:
- {"check": "status_code", "expected": 404}
- {"check": "content.success", "expected": false}
- {"check": "status_code", "expect": 404}
- {"check": "content.success", "expect": false}
- test:
name: create user which does not exist
@@ -40,16 +40,16 @@
- user_password: "123456"
api: create_user(1000, $user_name, $user_password, $token)
validate:
- {"check": "status_code", "expected": 201}
- {"check": "content.success", "expected": true}
- {"check": "status_code", "expect": 201}
- {"check": "content.success", "expect": true}
- test:
name: get user that has been created
api: get_user(1000, $token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.success", "expected": true}
- {"check": "content.data.password", "expected": "123456"}
- {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true}
- {"check": "content.data.password", "expect": "123456"}
- test:
name: create user which exists
@@ -58,8 +58,8 @@
- user_password: "123456"
api: create_user(1000, $user_name, $user_password, $token)
validate:
- {"check": "status_code", "expected": 500}
- {"check": "content.success", "expected": false}
- {"check": "status_code", "expect": 500}
- {"check": "content.success", "expect": false}
- test:
name: update user which exists
@@ -68,37 +68,37 @@
- user_password: "654321"
api: update_user(1000, $user_name, $user_password, $token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.success", "expected": true}
- {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true}
- test:
name: get user that has been updated
api: get_user(1000, $token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.success", "expected": true}
- {"check": "content.data.password", "expected": "654321"}
- {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true}
- {"check": "content.data.password", "expect": "654321"}
- test:
name: get users
api: get_users($token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.count", "expected": 1}
- {"check": "status_code", "expect": 200}
- {"check": "content.count", "expect": 1}
- test:
name: delete user that exists
api: delete_user(1000, $token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.success", "expected": true}
- {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true}
- test:
name: get users
api: get_users($token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.count", "expected": 0}
- {"check": "status_code", "expect": 200}
- {"check": "content.count", "expect": 0}
- test:
name: create user which has been deleted
@@ -107,12 +107,12 @@
- user_password: "123456"
api: create_user(1000, $user_name, $user_password, $token)
validate:
- {"check": "status_code", "expected": 201}
- {"check": "content.success", "expected": true}
- {"check": "status_code", "expect": 201}
- {"check": "content.success", "expect": true}
- test:
name: get users
api: get_users($token)
validate:
- {"check": "status_code", "expected": 200}
- {"check": "content.count", "expected": 1}
- {"check": "status_code", "expect": 200}
- {"check": "content.count", "expect": 1}

View File

@@ -28,8 +28,8 @@
extract:
- token: content.token
validate:
- {"check": "status_code", "comparator": "eq", "expected": 200}
- {"check": "content.token", "comparator": "len_eq", "expected": 16}
- {"check": "status_code", "comparator": "eq", "expect": 200}
- {"check": "content.token", "comparator": "len_eq", "expect": 16}
- test:
name: create user which does not exist
@@ -45,8 +45,8 @@
name: $user_name
password: $user_password
validate:
- {"check": "status_code", "comparator": "eq", "expected": 201}
- {"check": "content.success", "comparator": "eq", "expected": true}
- {"check": "status_code", "comparator": "eq", "expect": 201}
- {"check": "content.success", "comparator": "eq", "expect": true}
- test:
name: create user which does not exist
@@ -59,5 +59,5 @@
name: "user1"
password: "123456"
validate:
- {"check": "status_code", "comparator": "eq", "expected": 500}
- {"check": "content.success", "comparator": "eq", "expected": false}
- {"check": "status_code", "comparator": "eq", "expect": 500}
- {"check": "content.success", "comparator": "eq", "expect": false}

View File

@@ -38,8 +38,8 @@
extract:
- token: content.token
validate:
- {"check": "status_code", "comparator": "eq", "expected": 200}
- {"check": "content.token", "comparator": "len_eq", "expected": 16}
- {"check": "status_code", "comparator": "eq", "expect": 200}
- {"check": "content.token", "comparator": "len_eq", "expect": 16}
- test:
name: create user which does not exist
@@ -55,8 +55,8 @@
name: $user_name
password: $user_password
validate:
- {"check": "status_code", "comparator": "eq", "expected": 201}
- {"check": "content.success", "comparator": "eq", "expected": true}
- {"check": "status_code", "comparator": "eq", "expect": 201}
- {"check": "content.success", "comparator": "eq", "expect": true}
- test:
name: create user which does not exist
@@ -69,5 +69,5 @@
name: "user1"
password: "123456"
validate:
- {"check": "status_code", "comparator": "eq", "expected": 500}
- {"check": "content.success", "comparator": "eq", "expected": false}
- {"check": "status_code", "comparator": "eq", "expect": 500}
- {"check": "content.success", "comparator": "eq", "expect": false}

View File

@@ -29,8 +29,8 @@
extract:
- token: content.token
validate:
- {"check": "status_code", "comparator": "eq", "expected": 200}
- {"check": "content.token", "comparator": "len_eq", "expected": 16}
- {"check": "status_code", "comparator": "eq", "expect": 200}
- {"check": "content.token", "comparator": "len_eq", "expect": 16}
- test:
name: create user which does not exist
@@ -46,8 +46,8 @@
name: $user_name
password: $user_password
validate:
- {"check": "status_code", "comparator": "eq", "expected": 201}
- {"check": "content.success", "comparator": "eq", "expected": true}
- {"check": "status_code", "comparator": "eq", "expect": 201}
- {"check": "content.success", "comparator": "eq", "expect": true}
- test:
name: create user which does not exist
@@ -60,5 +60,5 @@
name: "user1"
password: "123456"
validate:
- {"check": "status_code", "comparator": "eq", "expected": 500}
- {"check": "content.success", "comparator": "eq", "expected": false}
- {"check": "status_code", "comparator": "eq", "expect": 500}
- {"check": "content.success", "comparator": "eq", "expect": false}