mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-07 15:31:23 +08:00
change: override variables
(1) testcase: session variables > step variables > config variables (2) testsuite: testcase variables > config variables (3) testsuite testcase variables > testcase config variables
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
config:
|
||||
name: "request methods testcase: reference testcase"
|
||||
variables:
|
||||
foo1: session_bar1
|
||||
foo1: testsuite_config_bar1
|
||||
expect_foo1: testsuite_config_bar1
|
||||
expect_foo2: config_bar2
|
||||
base_url: "https://postman-echo.com"
|
||||
verify: False
|
||||
|
||||
@@ -9,10 +11,11 @@ teststeps:
|
||||
-
|
||||
name: request with functions
|
||||
variables:
|
||||
foo1: override_bar1
|
||||
foo1: testcase_ref_bar1
|
||||
expect_foo1: testcase_ref_bar1
|
||||
testcase: request_methods/request_with_functions.yml
|
||||
export:
|
||||
- session_foo2
|
||||
- foo3
|
||||
-
|
||||
name: post form data
|
||||
variables:
|
||||
@@ -23,8 +26,8 @@ teststeps:
|
||||
headers:
|
||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
||||
Content-Type: "application/x-www-form-urlencoded"
|
||||
data: "foo1=$foo1&foo2=$session_foo2"
|
||||
data: "foo1=$foo1&foo2=$foo3"
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.form.foo1", "session_bar1"]
|
||||
- eq: ["body.form.foo2", "session_bar2"]
|
||||
- eq: ["body.form.foo1", "bar1"]
|
||||
- eq: ["body.form.foo2", "bar21"]
|
||||
|
||||
Reference in New Issue
Block a user