阅读 131

httprunner2.3自动化测试报告脚本




    utf-8/>
    description content=‘‘/>
    robots content=noodp, noydir/>
    viewport content=width=device-width, initial-scale=1/>
    "timeStampFormat" name="timeStampFormat" content=MMM d, yyyy hh:mm:ss a/>
 
    https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600 rel=stylesheet type=text/css>
    "https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
 
    http://extentreports.com/resx/dist/css/extent.css type=text/css rel=stylesheet/>
 
    {{ html_report_name }} - TestReport
 
    
 

 
class=extent standard default hide-overflow dark>
theme-selector alt=切换主题,默认黑色 title=切换主题> class=material-icons>desktop_windows
class=container>
test-view class=view>
controls>
class=controls grey lighten-4>
class=chip transparent alt=Search Tests title=Search Tests> "#" class=search-div> class=material-icons>search 查找
class=input-field left hide> "color: red" id=search-tests type=text class=validate browser-default placeholder=Search Tests...>
test-view-charts class=subview-full noncar-seventy-five>
charts-row class=noncar-wrap>
class= noncar-inside>
class=noncar-title>
class=left panel-name>驾驶舱接口自动化测试报告
class="noncar-content">
class="noncar-content-l" >
class=block text> class=strong tooltipped data-position=top>总测试: {{ stat.testcases.total }}
class=block text> class=strong tooltipped data-position=top>成功: {{ stat.testcases.success }}
class=block text> class=strong tooltipped data-position=top>失败: {{ stat.testcases.fail }}
class="noncar-content-r" style="-webkit-tap-highlight-color: transparent; user-select: none; position: relative; background: transparent;">
class=chart-box width="369" height="140" data-zr-dom-id="zr_0" style="position: absolute; left: 0px; top: 0px; width: 369px; height: 140px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0px; margin: 0px; border-width: 0px;"> "child-analysis" width="369" height="140" style="position: absolute; left: 0px; top: 0px; width: 369px; height: 140px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0px; margin: 0px; border-width: 0px;">
charts-row class=noncar-wrap>
class= noncar-inside>
class=noncar-title>
class=left panel-name>测试详情
class="noncar-content">
class="noncar-content-l" >
class=block text> class=strong tooltipped data-position=top>总数: {{ stat.teststeps.total }}
class=block text> class=strong tooltipped data-position=top>成功: {{ stat.teststeps.successes }}
class=block text> class=strong tooltipped data-position=top>失败: {{ stat.teststeps.failures }}
class=block text> class=strong tooltipped data-position=top>错误: {{ stat.teststeps.errors }}
class=block text> class=strong tooltipped data-position=top>跳过: {{ stat.teststeps.skipped }}
class="noncar-content-r" style="-webkit-tap-highlight-color: transparent; user-select: none; position: relative; background: transparent;">
class=chart-box width="369" height="140" style="position: absolute; left: 0px; top: 0px; width: 369px; height: 140px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0px; margin: 0px; border-width: 0px;"> parent-analysis width=369 height=140 style="position: absolute; left: 0px; top: 0px; width: 369px; height: 140px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0px; margin: 0px; border-width: 0px;">
class=subview-left left>
class=view-summary>
测试详情
    test-collection class=test-collection> {% for test_suite_summary in details %} {% if test_suite_summary.success == True %}
  • class=test displayed active has-leaf pass status=pass bdd=true test-id={{ test_suite_summary.name }}_{{ loop.index }}> {% else %}
  • class=test displayed active has-leaf fail status=fail bdd=false test-id={{ test_suite_summary.name }}_{{ loop.index }}> {% endif %}
    class=test-heading> class=test-name>{{ test_suite_summary.name }} {% if test_suite_summary.success == True %} class=test-status right pass>成功 {% else %} class=test-status right fail>失败 {% endif %}
    class=test-content hide>
    class=test-time-info> class=label start-time>{{ test_suite_summary.time.start_at }} class=label end-time>{{ %0.3f| format(test_suite_summary.time.duration|float) }} seconds
    class=test-desc>成功: {{ test_suite_summary.stat.successes }} ; 失败: {{ test_suite_summary.stat.failures }} ; 错误: {{ test_suite_summary.stat.errors }} 跳过: {{ test_suite_summary.stat.skipped }} ;
      class=collapsible node-list data-collapsible=accordion> {% for record in test_suite_summary.records %} {% set record_index = "{}_{}".format(suite_index, loop.index) %} {% set record_meta_datas = record.meta_datas_expanded %} {% if record.status == success %}
    • class=node level-1 leaf pass status=pass test-id={{ test_suite_summary.name }}_{{ record.name }}_{{ loop.index }}> {% elif record.status == failure %}
    • class=node level-1 leaf fail status=fail test-id={{ test_suite_summary.name }}_{{ record.name }}_{{ loop.index }}> {% elif record.status == error %}
    • class=node level-1 leaf error status=error test-id={{ test_suite_summary.name }}_{{ record.name }}_{{ loop.index }}> {% elif record.status == skipped %}
    • class=node level-1 leaf skip status=skip test-id={{ test_suite_summary.name }}_{{ record.name }}_{{ loop.index }}> {% endif %}
      class=collapsible-header>
      class=node-name>{{ record.name }}
      class=node-duration>响应时间: {{ record.response_time }} ms {% if record.status == success %} class=test-status right pass>通过 {% elif record.status == failure %} class=test-status right fail>失败 {% elif record.status == error %} class=test-status right error>错误 {% elif record.status == skipped %} class=test-status right skip>跳过 {% endif %}
      class=collapsible-body> {% for meta_data in record_meta_datas %} {% set meta_data_index = loop%}
      class=node-steps> {% for req_resp in meta_data.data %} class=bordered table-results> {% if record.status == skipped %} {% if record.attachment %} class=fail status=fail> {% endif %} {% else %} {% if loop.index > 1 %}
      class="separator" align="center">==================================== redirect to ====================================
      {% endif %} class=info status=info> {% if req_resp.request.method %} class=info status=info> {% endif %} class=info status=info> {% for key, value in req_resp.request.items() %} {% if key != urland key != methodand key != start_timestamp %} class=warning status=warning> {% if key == "headers" %} {% else %} {% endif %} {% endif %} {% endfor %} {% if meta_data_index.length > 1 %}
      class="separator" align="center">==================================== request_{{meta_data_index.index}} ====================================
      {% endif%} {% for key, value in req_resp.response.items() %} {% if key != "elapsed_ms"and key != "response_time_ms"and key != "content_size"and key != "content_type"and key != "status_code"and key != "reason"and key != "ok"and key != "encoding"and key != "url"and value %} class=error status=error> {% if key == "headers" %} {% else %} {% endif %} {% endif %} {% endfor %} class=pass status=pass> class=info status=info> {% if record.attachment and meta_data_index.last %} class=fail status=fail> {% endif %} {% endif %}
      Status Params Details
      class=status fail title=exception alt=fail><i class=material-icons>cancel class=timestamp>traceback class=step-details>
      class="code-block">{{ record.attachment | e }}
      class=status info title=接口地址 alt=info><i class=material-icons>low_priority class=timestamp>url class=step-details>{{ req_resp.request.url }}
      class=status info title=请求方式 alt=info><i class=material-icons>low_priority class=timestamp>method class=step-details>{{ req_resp.request.method }}
      class=status info title=状态码 alt=info><i class=material-icons>low_priority class=timestamp>status_code class=step-details>{{ req_resp.response.status_code }}
      class=status warning title={{ key }} alt=warning><i class=material-icons>low_priorityclass=timestamp>req_headerclass=timestamp>{{ key }}class=step-details> {% if key == "headers" %} {% for header_key, header_value in req_resp.response.headers.items() %}
      {{ header_key }}: {{ header_value | e}}
      {% endfor %} {% else %} {{ value }} {% endif %}
      class=status error title={{ key }} alt=error><i class=material-icons>low_priorityclass=timestamp>rsp_headerclass=timestamp>{{ key }}class=step-details> {% if key == "headers" %} {% for header_key, header_value in req_resp.response.headers.items() %}
      class="code-block">{{ header_key }}: {{ header_value }}
      {% endfor %} {% elif key == "content" %} {% if "image" in req_resp.response.content_type %} "{{ req_resp.response.content }}" /> {% else %} {{ value }} {% endif %} {% elif key in ["text", "json"] %} {% if value is mapping%}
      {{ value | tojson | e }}
      {% else %}
      {{ value | e }}
      {% endif %} {% elif key == "cookies" %} {% for cookies_key, cookies_value in req_resp.response.cookies.items() %}
      {{ cookies_key }}: {{ cookies_value }}
      {% endfor %} {% else %} {{ value }} {% endif %}
      class=status pass title=断言 alt=pass><i class=material-icons>low_priority class=timestamp>Validators "checkvalue" > {% for validator in meta_data.validators %} {% if validator.check_result == "pass" %} {% elif validator.check_result == "fail" %} {% elif validator.check_result == "unchecked" %} {% endif %} {% endfor %}
      check comparator expect value actual value result
      {{validator.check | e}} {{validator.comparator}} {{validator.expect | e}} {{validator.check_value | e}}class="test-status pass">通过class="test-status fail">失败class="test-status skip">unchecked
      class=status info title=info alt=info><i class=material-icons>low_priority class=timestamp>Statistics class=step-details>
      content_size(bytes): {{ meta_data.stat.content_size }}
      response_time(ms): {{ meta_data.stat.response_time_ms }}
      elapsed(ms): {{ meta_data.stat.elapsed_ms }}
      class=status fail title=exception alt=fail><i class=material-icons>cancel class=timestamp>traceback class=step-details>
      class="code-block">{{ record.attachment | e }}
      {% endfor %}
      {% endfor %}
    • {% endfor %}
    {% endfor %}
class=subview-right left>
category-view class=view hide>
controls>
class=controls grey lighten-4>
class=chip transparent alt=Search Tests title=Search Tests> "#" class=search-div> class=material-icons>search Search
class=input-field left hide> "color: red;" id=search-tests type=text class=validate browser-default placeholder=Search Tests...>
class=subview-left left>
class=view-summary>
Categories
    category-collection class=category-collection>
  • class=category displayed active>
    class=category-heading> class=category-name>All TESTCASES class=category-status right> class=label pass>{{ stat.testcases.success }} {% if stat.testcases.fail != 0 %} class=label fail>{{ stat.testcases.fail }} {% endif %}
    class=category-content hide>
    class=category-status-counts> class=label green accent-4 white-text>Passed: {{ stat.teststeps.successes }} class=label red lighten-1 white-text>Failed: {{ stat.teststeps.failures }} class=label blue lighten-1 white-text>Errored: {{ stat.teststeps.errors }} class="label yellow darken-2 white-text">Skipped: {{ stat.teststeps.skipped }}
    class=category-tests> class=bordered table-results> {% for test_suite_summary in details %} "border: 1px solid #49cc90; background-color: rgba(73, 204, 144, .1)"> {% if test_suite_summary.success == True %} {% else %} {% endif %} {% for record in test_suite_summary.records %} {% if record.status == success %} {% elif record.status == failure %} {% elif record.status == error %} {% elif record.status == skipped %} {% endif %} {% endfor %} {% endfor %}
    Timestamp TestName Status
    {{ %0.3f| format(test_suite_summary.time.duration|float) }} s class=linked test-id={{ test_suite_summary.name }}_{{ loop.index }}>{{ test_suite_summary.name }}class=test-status pass>成功class=test-status fail>失败
    {{ record.response_time }} ms class=linked test-id={{ test_suite_summary.name }}_{{ loop.index }}>{{ record.name }}class=test-status pass>成功class=test-status fail>失败class=test-status error>错误class=test-status style="color: #fbc02d">跳过
  • {% for test_suite_summary in details %}
  • class=category displayed active>
    class=category-heading> class=category-name>{{ test_suite_summary.name }} class=category-status right> class=label pass>{{ test_suite_summary.stat.successes }} {% if test_suite_summary.stat.failures != 0 %} class=label fail>{{ test_suite_summary.stat.failures }} {% endif %} {% if test_suite_summary.stat.errors != 0 %} class=label blue lighten-1>{{ test_suite_summary.stat.errors }} {% endif %} {% if test_suite_summary.stat.skipped != 0 %} class=label yellow darken-2>{{ test_suite_summary.stat.skipped }} {% endif %}
    class=category-content hide>
    class=category-status-counts> class=label green accent-4 white-text>Passed: {{ test_suite_summary.stat.successes }} class=label red lighten-1 white-text>Failed: {{ test_suite_summary.stat.failures }} class=label blue lighten-1 white-text>Errored: {{ test_suite_summary.stat.errors }} class="label yellow darken-2 white-text">Skipped: {{ test_suite_summary.stat.skipped }}
    class=category-tests> class=bordered table-results> {% for record in test_suite_summary.records %} {% if record.status == success %} {% elif record.status == failure %} {% elif record.status == error %} {% elif record.status == skipped %} {% endif %} {% endfor %}
    Timestamp TestName Status
    {{ record.response_time }} class=linked test-id={{ test_suite_summary.name }}_{{ loop.index }}>{{ record.name }}class=test-status pass>成功class=test-status fail>失败class=test-status error>错误class=test-status style="color: #fbc02d">跳过
  • {% endfor %}
class=subview-right left>
class=view-summary>
class=category-name>
> >

 

原文:https://www.cnblogs.com/camillezxl/p/14900693.html

文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐