mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
fix: display api name when running api as testcase
This commit is contained in:
@@ -1254,6 +1254,9 @@ def parse_tests(tests_mapping):
|
|||||||
# encapsulate api as a testcase
|
# encapsulate api as a testcase
|
||||||
for api_content in tests_mapping["apis"]:
|
for api_content in tests_mapping["apis"]:
|
||||||
testcase = {
|
testcase = {
|
||||||
|
"config": {
|
||||||
|
"name": api_content.get("name")
|
||||||
|
},
|
||||||
"teststeps": [api_content]
|
"teststeps": [api_content]
|
||||||
}
|
}
|
||||||
parsed_testcase = _parse_testcase(testcase, project_mapping)
|
parsed_testcase = _parse_testcase(testcase, project_mapping)
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
|
||||||
name: headers
|
name: get headers
|
||||||
base_url: http://httpbin.org
|
base_url: http://httpbin.org
|
||||||
|
variables:
|
||||||
|
expected_status_code: 200
|
||||||
request:
|
request:
|
||||||
url: /headers
|
url: /headers
|
||||||
method: GET
|
method: GET
|
||||||
validate:
|
validate:
|
||||||
- eq: ["status_code", 200]
|
- eq: ["status_code", $expected_status_code]
|
||||||
- eq: [content.headers.Host, "httpbin.org"]
|
- eq: [content.headers.Host, "httpbin.org"]
|
||||||
|
|||||||
Reference in New Issue
Block a user