feat: save testcase log absolute path in summary.json

This commit is contained in:
debugtalk
2020-03-10 19:08:11 +08:00
parent 856295a68d
commit b1287da8cb

View File

@@ -179,7 +179,7 @@ class HttpRunner(object):
"details": []
}
for tests_result in tests_results:
for index, tests_result in enumerate(tests_results):
testcase, result = tests_result
testcase_summary = report.get_summary(result)
@@ -195,6 +195,12 @@ class HttpRunner(object):
report.aggregate_stat(summary["stat"]["teststeps"], testcase_summary["stat"])
report.aggregate_stat(summary["time"], testcase_summary["time"])
if self.save_tests:
logs_file_abs_path = utils.prepare_log_file_abs_path(
self.project_mapping, f"testcase_{index + 1}.log"
)
testcase_summary["log"] = logs_file_abs_path
summary["details"].append(testcase_summary)
return summary