mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-16 05:57:37 +08:00
implement method to get variables and output
This commit is contained in:
@@ -194,6 +194,35 @@ class HttpRunner(object):
|
||||
|
||||
return report_path
|
||||
|
||||
def get_vars_out(self):
|
||||
""" get variables and output
|
||||
Returns:
|
||||
list: list of variables and output.
|
||||
if tests are parameterized, list items are corresponded to parameters.
|
||||
|
||||
[
|
||||
{
|
||||
"in": {
|
||||
"user1": "leo"
|
||||
},
|
||||
"out": {
|
||||
"out1": "out_value_1"
|
||||
}
|
||||
},
|
||||
{...}
|
||||
]
|
||||
|
||||
None: returns None if tests not started or finished or corrupted.
|
||||
|
||||
"""
|
||||
if not self._summary:
|
||||
return None
|
||||
|
||||
return [
|
||||
summary["in_out"]
|
||||
for summary in self._summary["details"]
|
||||
]
|
||||
|
||||
def run_path(self, path, dot_env_path=None, mapping=None):
|
||||
""" run testcase/testsuite file or folder.
|
||||
|
||||
|
||||
@@ -805,7 +805,7 @@ def __parse_testcase_tests(tests, config, project_mapping):
|
||||
project_mapping (dict):
|
||||
|
||||
"""
|
||||
config_variables = config.pop("variables", {})
|
||||
config_variables = config.get("variables", {})
|
||||
config_base_url = config.pop("base_url", "")
|
||||
config_verify = config.pop("verify", True)
|
||||
functions = project_mapping.get("functions", {})
|
||||
|
||||
Reference in New Issue
Block a user