From e2f9ad4e050f95edd2275b70a0d208f284141d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=85=A8=E6=97=BA?= Date: Wed, 25 Jul 2018 17:52:21 +0800 Subject: [PATCH 1/2] update extent_report_template for suites --- .../templates/extent_report_template.html | 693 +++++++++++++----- 1 file changed, 500 insertions(+), 193 deletions(-) diff --git a/httprunner/templates/extent_report_template.html b/httprunner/templates/extent_report_template.html index e9ab26d9..0b8424fa 100644 --- a/httprunner/templates/extent_report_template.html +++ b/httprunner/templates/extent_report_template.html @@ -1,18 +1,21 @@ + + + + {{ html_report_name }} - TestReport - 接口自动化测试报告 - -
+ +
desktop_windows
+ +
+
+
@@ -79,18 +96,37 @@ data-beloworigin='true' data-hover='true' href='#'> warning Status -
+ +
+ + local_offer Category + + +
+ + + -
+ +
-
-
-
-
Tests
-
- -
-
- - {{ stat.successes }} test(s) passed -
-
+ +
+
+
+
+
Tests
+
+ +
+
+ {{ stat.successes }} test(s) passed +
+
{{ stat.errors }} test(s) failed, - {{ stat.skipped }} test(s) skipped + data-tooltip='62.5%'>{{ stat.errors }} test(s) + failed, {{ stat.skipped }} + test(s) skipped +
-
-
-
-
Steps
-
- -
-
- - {{ stat.expectedFailures }}test(s) expectedFailures -
-
- {{ stat.unexpectedSuccesses }}test(s) unexpectedSuccesses + +
+
+
Suite
+
+ +
+
+ + + +
+
+ suite(s) failed +
+
-
+
+
Tests
    - {% for record in records %} - {% if record.status == 'success' %} -
  • -
    - {{ record.name }} - {{ record.meta_data.response_time_ms }} ms - pass -
    - {% elif record.status == 'error' %} -
  • -
    - {{ record.name }} - {{ record.meta_data.response_time_ms }} ms - fail -
    + + {% for test_suite_summary in details %} + {% if test_suite_summary.success == true %} +
  • + {% else %} +
  • {% endif %} -
    -
    - {{ record.meta_data.response_time_ms }} ms +
    + {{ test_suite_summary.name }} + {{ test_suite_summary.base_url }} + {% if test_suite_summary.success == true %} + pass + {% else %} + fail + {% endif %} + +
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    +
    + {{ test_suite_summary.time.start_at }} + {{ '%0.3f'| format(test_suite_summary.time.duration|float) }} seconds +
    +
    Pass: {{ test_suite_summary.stat.successes }} ; + Fail: {{ test_suite_summary.stat.errors }} ; + Skip: {{ test_suite_summary.stat.skipped }} ; + Error: {{ test_suite_summary.stat.failures }}
    +
    +
    + {{ test_suite_summary.name }} + {{ test_suite_summary.base_url }} +
    +
    +
      + {% for record in test_suite_summary.records %} + {% if record.status == 'success' %} +
    • + {% elif record.status == 'error' %} +
    • + {% elif record.status == 'skipped' %} +
    - - - - + +
    +
    + {{ test_suite_summary.name }} + {{ record.name }} +
    +
    +
    StatusIdentityDetails
    low_priorityurl{{ record.meta_data.url }}
    low_prioritymethod{{ record.meta_data.method }}
    low_prioritystatus_code{{ record.meta_data.status_code }}
    low_priorityreq_headers - {% for key, value in record.meta_data.request_headers.items() %} -
    - {{ key }}: {{ value }} -
    - {% endfor %}
    low_priorityreq_body{{ record.meta_data.request_body }}
    low_priorityresp_headers - {% for key, value in record.meta_data.response_headers.items() %} -
    - {{ key }}: {{ value }} -
    - {% endfor %}
    low_priorityresp_body - {% if record.meta_data.response_data_type == "image" %} - - {% else %} -
    {{ record.meta_data.response_body }}
    - {% endif %} -
    low_prioritycontent_size{{ record.meta_data.content_size }} bytes
    + + + + + + + + + + + + + + + + + + + + + + + + {% for key, value in record.meta_data.request.items() %} + {% if key != 'url' and key != 'method' %} + + + + - {% if record.attachment != '' %} - - - - - + + {% endif %} + {% endfor %} - {% endif %} - -
    StatusParamsDetails
    low_priorityurl{{ record.meta_data.request.url }}
    low_prioritymethod{{ record.meta_data.request.method }}
    low_prioritystatus_code{{ record.meta_data.response.status_code }}
    low_priority{{ key }} + {% if key == "headers" %} + {% for header_key, header_value in record.meta_data.request.headers.items() %} +
    + {{ header_key }}: {{ header_value }} +
    + {% endfor %} + {% else %} + {{ value }} + {% endif %} +
    cancelexception: -
    {{ record.attachment }}
    -
    + {% for key, value in record.meta_data.response.items() %} + {% if key != 'status_code' %} + + low_priority + {{ key }} + + {% if key == "headers" %} + {% for header_key, header_value in record.meta_data.request.headers.items() %} +
    + {{ header_key }}: {{ header_value }} +
    + {% endfor %} + {% elif key == "content_type" %} + {% if value == "image" %} + + {% else %} +
    {{ record.meta_data.response.body }}
    + {% endif %} + {% else %} + {{ value }} + {% endif %} + + + {% endif %} + {% endfor %} + + + low_priority + Validators + + {% for validator in record.meta_data.validators %} +
    + {{ validator.comparator }}:[ {{ validator.expect }} + ,  {{ validator.check_value }} ] +
    + {% endfor %} + + + + + low_priority + Statistics + +
    + content_size(bytes): {{ record.meta_data.response.content_size }} +
    +
    + response_time(ms): {{ record.meta_data.response.response_time_ms }} +
    +
    + elapsed(ms): {{ record.meta_data.response.elapsed_ms }} +
    + + + + + {% if record.attachment %} + + cancel + exception: + +
    {{ record.attachment }}
    + + + {% endif %} + + +
    +
    +
  • + {% endfor %} +
-
- {% endfor %}
+
+
info_outline @@ -293,7 +423,8 @@ class="material-icons">cancel error - warning + warning redo
-
+ +
+ +
+
+ +
+ + search Search + + +
+ +
+ +
+ +
+
+ +
+ +
+
Categories
+
    + +
  • +
    + All Tests + + {{ stat.successes }} + {% if stat.errors != 0 %} + {{ stat.errors }} + {% endif %} + {% if stat.skipped != 0 %} + {{ stat.skipped }} + {% endif %} + +
    +
    +
    + Passed: {{ stat.successes }} + Failed: {{ stat.errors }} + Skipped: {{ stat.skipped }} +
    + +
    + + + + + + + + + + {% for test_suite_summary in details %} + + + + {% if test_suite_summary.success == true %} + + {% else %} + + {% endif %} + + + {% for record in test_suite_summary.records %} + + + + {% if record.status == 'success' %} + + {% else %} + + {% endif %} + + {% endfor %} + {% endfor %} + +
    TimestampTestNameStatus
    {{ test_suite_summary.time.start_at }}{{ test_suite_summary.name }}passfail
    {{ record.meta_data.request.start_timestamp }}{{ record.name }}passfail
    +
    +
    +
  • + + {% for test_suite_summary in details %} +
  • +
    + {{ test_suite_summary.name }} + + {{ test_suite_summary.stat.successes }} + {% if test_suite_summary.stat.errors != 0 %} + {{ test_suite_summary.stat.errors }} + {% endif %} + {% if test_suite_summary.stat.skipped != 0 %} + {{ test_suite_summary.stat.skipped }} + {% endif %} + +
    +
    +
    + Passed: {{ test_suite_summary.stat.successes }} + Failed: {{ test_suite_summary.stat.errors }} + Skipped: {{ test_suite_summary.stat.skipped }} +
    + +
    + + + + + + + + + + {% for record in test_suite_summary.records %} + + + + {% if record.status == 'success' %} + + {% else %} + + {% endif %} + + {% endfor %} + +
    TimestampTestNameStatus
    {{ record.meta_data.request.start_timestamp }}{{ record.name }}passfail
    +
    +
    +
  • + {% endfor %} +
+
+
+ +
+
+
+
+
+
+
Dashboard
+
-
-
- Tests -
{{ stat.testsRun }}
-
-
Pass @@ -336,7 +610,7 @@
Start -
{{ time.start_at.strftime('%Y-%m-%d %H:%M:%S') }}
+
{{ time.start_datetime }}
@@ -345,60 +619,93 @@
{{ '%0.3f'| format(time.duration|float) }} seconds
+
+
+ Categories +

 

+ + + + + + + + + + + + + + + -
-
- PLATFORM -
HttpRunner {{ platform.httprunner_version }}
+ {% for test_suite_summary in details %} +
+ + + + + + + {% endfor %} +
NamePassedFailedSkippedError
All Tests{{ stat.successes }}{{ stat.errors }}{{ stat.skipped }}{{ stat.failures }}
{{ test_suite_summary.name }}{{ test_suite_summary.stat.successes }}{{ test_suite_summary.stat.errors }}{{ test_suite_summary.stat.skipped }}{{ test_suite_summary.stat.failures }}
- -
-
- Python Version -
{{ platform.python_version }}
-
-
- -
-
- Agent -
{{ platform.platform }}
-
-
-
+
- + + + - \ No newline at end of file + From e66b442e359dd11332151ba5f95c3f5feaa63088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=85=A8=E6=97=BA?= Date: Wed, 25 Jul 2018 18:04:59 +0800 Subject: [PATCH 2/2] All Tests change to All Suites --- httprunner/templates/extent_report_template.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/httprunner/templates/extent_report_template.html b/httprunner/templates/extent_report_template.html index 0b8424fa..6f563722 100644 --- a/httprunner/templates/extent_report_template.html +++ b/httprunner/templates/extent_report_template.html @@ -31,14 +31,14 @@ - -
+ +
desktop_windows