fix: show assert value type when validation failed

This commit is contained in:
debugtalk
2020-04-21 15:13:48 +08:00
parent 43c4c6590b
commit 25b37ebc57
3 changed files with 4 additions and 33 deletions

View File

@@ -44,7 +44,7 @@ class TestCaseRequestMethodsWithFunctions(TestCaseRunner):
{"eq": ["status_code", 200]},
{"eq": ["body.args.foo1", "session_bar1"]},
{"eq": ["body.args.foo2", "session_bar2"]},
{"eq": ["body.args.sum_v", "3"]}
{"eq": ["body.args.sum_v", 3]}
]
}),
TestStep(**{

View File

@@ -27,34 +27,3 @@ teststeps:
- eq: ["status_code", 200]
- eq: ["body.args.sum_v", "3"]
- less_than: ["body.args.sum_v", "${sum_two(2, 2)}"]
-
name: post raw text
variables:
foo1: "hello world"
foo3: "$session_foo2"
request:
method: POST
url: /post
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
Content-Type: "text/plain"
data: "This is expected to be sent back as part of response body: $foo1-$foo3."
validate:
- eq: ["status_code", 200]
- eq: ["body.data", "This is expected to be sent back as part of response body: session_bar1-session_bar2."]
-
name: post form data
variables:
foo1: bar1
foo2: bar2
request:
method: POST
url: /post
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
Content-Type: "application/x-www-form-urlencoded"
data: "foo1=$foo1&foo2=$foo2"
validate:
- eq: ["status_code", 200]
- eq: ["body.form.foo1", "session_bar1"]
- eq: ["body.form.foo2", "bar2"]