Files
httprunner/tests/httpbin/upload.yml
debugtalk 4099ade49d HttpRunner 2.0 is comming!
1, new design for testcase format;
2, refactor testcase layer mechanism.
2018-11-22 19:25:00 +08:00

22 lines
601 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"]