mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
30 lines
754 B
YAML
30 lines
754 B
YAML
- config:
|
|
name: test upload file with httpbin
|
|
base_url: ${get_httpbin_server()}
|
|
|
|
- test:
|
|
name: upload file
|
|
variables:
|
|
file_path: "data/test.env"
|
|
m_encoder: ${multipart_encoder(file=$file_path)}
|
|
request:
|
|
url: /post
|
|
method: POST
|
|
headers:
|
|
Content-Type: ${multipart_content_type($m_encoder)}
|
|
data: $m_encoder
|
|
validate:
|
|
- eq: ["status_code", 200]
|
|
- startswith: ["content.files.file", "UserName=test"]
|
|
|
|
- test:
|
|
name: upload file with keyword
|
|
request:
|
|
url: /post
|
|
method: POST
|
|
upload:
|
|
file: "data/test.env"
|
|
validate:
|
|
- eq: ["status_code", 200]
|
|
- startswith: ["content.files.file", "UserName=test"]
|