fix: save extracted variables to session variables

This commit is contained in:
debugtalk
2020-07-30 11:28:32 +08:00
parent d0b439f8f4
commit 17ea5c594e
6 changed files with 6 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ class TestCaseRequestWithFunctions(HttpRunner):
.assert_equal("status_code", 200) .assert_equal("status_code", 200)
.assert_equal( .assert_equal(
"body.data", "body.data",
"This is expected to be sent back as part of response body: bar12-$expect_foo2-bar21.", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32.",
) )
.assert_type_match("body.json", "None") .assert_type_match("body.json", "None")
.assert_type_match("body.json", "NoneType") .assert_type_match("body.json", "NoneType")

View File

@@ -47,7 +47,7 @@ teststeps:
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3." data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
validate: validate:
- eq: ["status_code", 200] - eq: ["status_code", 200]
- eq: ["body.data", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar21."] - eq: ["body.data", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."]
- type_match: ["body.json", None] - type_match: ["body.json", None]
- type_match: ["body.json", NoneType] - type_match: ["body.json", NoneType]
- type_match: ["body.json", null] - type_match: ["body.json", null]

View File

@@ -57,7 +57,7 @@ class TestCaseRequestWithFunctions(HttpRunner):
.assert_equal("status_code", 200) .assert_equal("status_code", 200)
.assert_equal( .assert_equal(
"body.data", "body.data",
"This is expected to be sent back as part of response body: bar12-$expect_foo2-bar21.", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32.",
) )
.assert_type_match("body.json", "None") .assert_type_match("body.json", "None")
.assert_type_match("body.json", "NoneType") .assert_type_match("body.json", "NoneType")

View File

@@ -38,7 +38,7 @@ teststeps:
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3." data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
validate: validate:
- eq: ["status_code", 200] - eq: ["status_code", 200]
- eq: ["body.data", "This is expected to be sent back as part of response body: bar12-testcase_config_bar2-bar21."] - eq: ["body.data", "This is expected to be sent back as part of response body: bar12-testcase_config_bar2-bar32."]
- -
name: post form data name: post form data
variables: variables:

View File

@@ -42,7 +42,7 @@ class TestCaseRequestWithVariables(HttpRunner):
.assert_equal("status_code", 200) .assert_equal("status_code", 200)
.assert_equal( .assert_equal(
"body.data", "body.data",
"This is expected to be sent back as part of response body: bar12-testcase_config_bar2-bar21.", "This is expected to be sent back as part of response body: bar12-testcase_config_bar2-bar32.",
) )
), ),
Step( Step(

View File

@@ -361,7 +361,7 @@ class HttpRunner(object):
# save extracted variables to session variables # save extracted variables to session variables
extracted_variables.update(extract_mapping) extracted_variables.update(extract_mapping)
self.__session_variables.update(extract_mapping) self.__session_variables.update(extracted_variables)
self.__duration = time.time() - self.__start_at self.__duration = time.time() - self.__start_at
return self return self