mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-01 13:59:37 +08:00
refactor: rename TestSuiteSummary field details to testcases
This commit is contained in:
@@ -147,7 +147,7 @@ def __stringify_response(response_data):
|
|||||||
def stringify_summary(testsuite_summary: TestSuiteSummary):
|
def stringify_summary(testsuite_summary: TestSuiteSummary):
|
||||||
""" stringify summary, in order to dump json file and generate html report.
|
""" stringify summary, in order to dump json file and generate html report.
|
||||||
"""
|
"""
|
||||||
for index, testcase_summary in enumerate(testsuite_summary.details):
|
for index, testcase_summary in enumerate(testsuite_summary.testcases):
|
||||||
|
|
||||||
if not testcase_summary.name:
|
if not testcase_summary.name:
|
||||||
testcase_summary.name = f"testcase {index}"
|
testcase_summary.name = f"testcase {index}"
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class HttpRunner(object):
|
|||||||
},
|
},
|
||||||
"time": {},
|
"time": {},
|
||||||
"platform": report.get_platform(),
|
"platform": report.get_platform(),
|
||||||
"details": []
|
"testcases": []
|
||||||
}
|
}
|
||||||
|
|
||||||
for testcase_summary in tests_results:
|
for testcase_summary in tests_results:
|
||||||
@@ -153,7 +153,7 @@ class HttpRunner(object):
|
|||||||
|
|
||||||
testsuite_summary["success"] &= testcase_summary.success
|
testsuite_summary["success"] &= testcase_summary.success
|
||||||
|
|
||||||
testsuite_summary["details"].append(testcase_summary)
|
testsuite_summary["testcases"].append(testcase_summary)
|
||||||
|
|
||||||
total_duration = tests_results[-1].time.start_at + tests_results[-1].time.duration \
|
total_duration = tests_results[-1].time.start_at + tests_results[-1].time.duration \
|
||||||
- tests_results[0].time.start_at
|
- tests_results[0].time.start_at
|
||||||
@@ -233,7 +233,7 @@ class HttpRunner(object):
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
testcase_summary.in_out.dict()
|
testcase_summary.in_out.dict()
|
||||||
for testcase_summary in self._summary.details
|
for testcase_summary in self._summary.testcases
|
||||||
]
|
]
|
||||||
|
|
||||||
def run_path(self, path, dot_env_path=None, mapping=None) -> TestSuiteSummary:
|
def run_path(self, path, dot_env_path=None, mapping=None) -> TestSuiteSummary:
|
||||||
|
|||||||
@@ -134,4 +134,4 @@ class TestSuiteSummary(BaseModel):
|
|||||||
stat: Stat
|
stat: Stat
|
||||||
time: TestCaseTime
|
time: TestCaseTime
|
||||||
platform: PlatformInfo
|
platform: PlatformInfo
|
||||||
details: List[TestCaseSummary]
|
testcases: List[TestCaseSummary]
|
||||||
|
|||||||
Reference in New Issue
Block a user