mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
new mapping style:
"variables": {
"a": 1,
"b": 2
}
Also, the former list style is still valid:
"variables": [
{"a": 1},
{"b": 2}
]
22 lines
593 B
YAML
22 lines
593 B
YAML
- config:
|
|
name: test upload file with httpbin
|
|
base_url: ${get_httpbin_server()}
|
|
|
|
- test:
|
|
name: upload file
|
|
variables:
|
|
field_name: "file"
|
|
file_path: "LICENSE"
|
|
file_type: "text/html"
|
|
multipart_encoder: ${multipart_encoder($field_name, $file_path, $file_type)}
|
|
request:
|
|
url: /post
|
|
method: POST
|
|
headers:
|
|
Content-Type: ${multipart_content_type($multipart_encoder)}
|
|
data: $multipart_encoder
|
|
validators:
|
|
- eq: ["status_code", 200]
|
|
- startswith: ["content.files.file", "MIT License"]
|
|
|