fix: convert jmespath.search result to int/float

This commit is contained in:
debugtalk
2020-05-31 10:53:43 +08:00
parent e22d828dca
commit 47cc964ecf
8 changed files with 14 additions and 9 deletions

View File

@@ -0,0 +1 @@
# NOTICE: Generated By HttpRunner. DO NOT EDIT!

View File

@@ -34,7 +34,7 @@ class TestCaseRequestWithFunctions(HttpRunner):
"validate": [
{"eq": ["status_code", 200]},
{"eq": ["body.args.foo1", "session_bar1"]},
{"eq": ["body.args.sum_v", 3]},
{"eq": ["body.args.sum_v", "3"]},
{"eq": ["body.args.foo2", "session_bar2"]},
],
}

View File

@@ -26,7 +26,7 @@ teststeps:
validate:
- eq: ["status_code", 200]
- eq: ["body.args.foo1", "session_bar1"]
- eq: ["body.args.sum_v", 3]
- eq: ["body.args.sum_v", "3"]
- eq: ["body.args.foo2", "session_bar2"]
-
name: post raw text

View File

@@ -34,7 +34,7 @@ class TestCaseRequestWithFunctions(HttpRunner):
"validate": [
{"eq": ["status_code", 200]},
{"eq": ["body.args.foo1", "session_bar1"]},
{"eq": ["body.args.sum_v", 3]},
{"eq": ["body.args.sum_v", "3"]},
{"eq": ["body.args.foo2", "session_bar2"]},
],
}

View File

@@ -25,5 +25,5 @@ teststeps:
session_foo2: "body.args.foo2"
validate:
- eq: ["status_code", 200]
- eq: ["body.args.sum_v", 3]
- less_than: ["body.args.sum_v", "${sum_two(2, 2)}"]
- eq: ["body.args.sum_v", "3"]
# - less_than: ["body.args.sum_v", "${sum_two(2, 2)}"] TODO

View File

@@ -33,8 +33,7 @@ class TestCaseValidateWithFunctions(HttpRunner):
"extract": {"session_foo2": "body.args.foo2"},
"validate": [
{"eq": ["status_code", 200]},
{"eq": ["body.args.sum_v", 3]},
{"less_than": ["body.args.sum_v", "${sum_two(2, 2)}"]},
{"eq": ["body.args.sum_v", "3"]},
],
}
),