mirror of
https://github.com/httprunner/httprunner.py.git
synced 2026-05-06 20:02:43 +08:00
38 lines
979 B
YAML
38 lines
979 B
YAML
config:
|
|
name: "request methods testcase: reference testcase"
|
|
variables:
|
|
foo1: testsuite_config_bar1
|
|
expect_foo1: testsuite_config_bar1
|
|
expect_foo2: config_bar2
|
|
base_url: "https://postman-echo.com"
|
|
verify: False
|
|
|
|
teststeps:
|
|
-
|
|
name: request with functions
|
|
variables:
|
|
foo1: testcase_ref_bar1
|
|
expect_foo1: testcase_ref_bar1
|
|
setup_hooks:
|
|
- ${sleep(0.1)}
|
|
testcase: request_methods/request_with_functions.yml
|
|
teardown_hooks:
|
|
- ${sleep(0.2)}
|
|
export:
|
|
- foo3
|
|
-
|
|
name: post form data
|
|
variables:
|
|
foo1: bar1
|
|
request:
|
|
method: POST
|
|
url: /post
|
|
headers:
|
|
User-Agent: HttpRunner/${get_httprunner_version()}
|
|
Content-Type: "application/x-www-form-urlencoded"
|
|
data: "foo1=$foo1&foo2=$foo3"
|
|
validate:
|
|
- eq: ["status_code", 200]
|
|
- eq: ["body.form.foo1", "bar1"]
|
|
- eq: ["body.form.foo2", "bar21"]
|