mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix base_url priority: testcase config > testsuite config
This commit is contained in:
@@ -893,6 +893,9 @@ def __get_parsed_testsuite_testcases(testcases, testsuite_config, project_mappin
|
||||
variables priority:
|
||||
parameters > testsuite config > testcase config > testcase_def config > testcase_def tests > api
|
||||
|
||||
base_url priority:
|
||||
testcase_def tests > testcase_def config > testcase config > testsuite config
|
||||
|
||||
Args:
|
||||
testcases (dict):
|
||||
{
|
||||
@@ -927,6 +930,7 @@ def __get_parsed_testsuite_testcases(testcases, testsuite_config, project_mappin
|
||||
}
|
||||
|
||||
"""
|
||||
testsuite_base_url = testsuite_config.get("base_url")
|
||||
testsuite_config_variables = testsuite_config.get("variables", {})
|
||||
functions = project_mapping.get("functions", {})
|
||||
parsed_testcase_list = []
|
||||
@@ -938,6 +942,9 @@ def __get_parsed_testsuite_testcases(testcases, testsuite_config, project_mappin
|
||||
parsed_testcase["path"] = testcase["testcase"]
|
||||
parsed_testcase["config"]["name"] = testcase_name
|
||||
|
||||
# base_url priority: testcase config > testsuite config
|
||||
parsed_testcase["config"].setdefault("base_url", testsuite_base_url)
|
||||
|
||||
# 1, testsuite config => testcase config
|
||||
# override test_dict variables
|
||||
testcase_config_variables = utils.extend_variables(
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
variables:
|
||||
uid: 9001
|
||||
device_sn: "TESTCASE_CREATE_XXX"
|
||||
base_url: "http://127.0.0.1:5000"
|
||||
|
||||
- test:
|
||||
name: setup and reset all (override) for $device_sn.
|
||||
|
||||
Reference in New Issue
Block a user