mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-16 20:37:38 +08:00
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
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
|
|
testcase: testcases/requests.yml
|
|
export:
|
|
- foo3
|
|
-
|
|
name: post form data
|
|
variables:
|
|
foo1: bar1
|
|
request:
|
|
method: POST
|
|
url: /post
|
|
headers:
|
|
User-Agent: funplugin/${get_version()}
|
|
Content-Type: "application/x-www-form-urlencoded"
|
|
body: "foo1=$foo1&foo2=$foo3"
|
|
validate:
|
|
- check: status_code
|
|
assert: equal
|
|
expect: 200
|
|
msg: check status_code
|
|
- check: body.form.foo1
|
|
assert: equal
|
|
expect: bar1
|
|
msg: check body.form.foo1
|
|
- check: body.form.foo2
|
|
assert: equal
|
|
expect: bar21
|
|
msg: check body.form.foo2 |