save api in individual file: each file is corresponding to one api definition

This commit is contained in:
debugtalk
2018-12-04 22:38:41 +08:00
parent 0cfb92aa4a
commit 0eacd5f7de
13 changed files with 150 additions and 14 deletions

22
tests/api/get_token.yml Normal file
View File

@@ -0,0 +1,22 @@
name: get token
variables:
user_agent: XXX
device_sn: API_XXX
os_platform: XXX
app_version: XXX
request:
url: /api/get-token
method: POST
headers:
user_agent: $user_agent
device_sn: $device_sn
os_platform: $os_platform
app_version: $app_version
Content-Type: "application/json"
device_sn: $device_sn
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"]