mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-20 07:40:32 +08:00
#169: add builtin support for uploading files
This commit is contained in:
22
tests/httpbin/upload.yml
Normal file
22
tests/httpbin/upload.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
- config:
|
||||
name: test upload file with httpbin
|
||||
request:
|
||||
base_url: https://httpbin.org
|
||||
|
||||
- test:
|
||||
name: upload file
|
||||
variable_binds:
|
||||
- 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"]
|
||||
|
||||
Reference in New Issue
Block a user