mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-10 23:12:41 +08:00
update testcase example
This commit is contained in:
11
README.md
11
README.md
@@ -86,8 +86,6 @@ And here is testset example of typical scenario: get token at the beginning, and
|
|||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: get token
|
name: get token
|
||||||
variable_binds:
|
|
||||||
- sign: ${get_sign($user_agent, $device_sn, $os_platform, $app_version)}
|
|
||||||
request:
|
request:
|
||||||
url: /api/get-token
|
url: /api/get-token
|
||||||
method: POST
|
method: POST
|
||||||
@@ -97,7 +95,7 @@ And here is testset example of typical scenario: get token at the beginning, and
|
|||||||
os_platform: $os_platform
|
os_platform: $os_platform
|
||||||
app_version: $app_version
|
app_version: $app_version
|
||||||
json:
|
json:
|
||||||
sign: $sign
|
sign: ${get_sign($user_agent, $device_sn, $os_platform, $app_version)}
|
||||||
extract_binds:
|
extract_binds:
|
||||||
- token: content.token
|
- token: content.token
|
||||||
validators:
|
validators:
|
||||||
@@ -106,17 +104,14 @@ And here is testset example of typical scenario: get token at the beginning, and
|
|||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: create user which does not exist
|
name: create user which does not exist
|
||||||
variable_binds:
|
|
||||||
- user_name: "user1"
|
|
||||||
- user_password: "123456"
|
|
||||||
request:
|
request:
|
||||||
url: /api/users/1000
|
url: /api/users/1000
|
||||||
method: POST
|
method: POST
|
||||||
headers:
|
headers:
|
||||||
token: $token
|
token: $token
|
||||||
json:
|
json:
|
||||||
name: $user_name
|
name: "user1"
|
||||||
password: $user_password
|
password: "123456"
|
||||||
validators:
|
validators:
|
||||||
- {"check": "status_code", "comparator": "eq", "expected": 201}
|
- {"check": "status_code", "comparator": "eq", "expected": 201}
|
||||||
- {"check": "content.success", "comparator": "eq", "expected": true}
|
- {"check": "content.success", "comparator": "eq", "expected": true}
|
||||||
|
|||||||
Reference in New Issue
Block a user