{% if desc %}
{{ desc }}
{% endif %}
{{ total }}
总用例
{{ passed }}
通过
{{ "%.1f"|format(passed / total * 100) if total else 0 }}%
{{ failed }}
失败
{{ "%.1f"|format(failed / total * 100) if total else 0 }}%
{{ skipped }}
跳过
{{ "%.1f"|format(skipped / total * 100) if total else 0 }}%
{{ error }}
错误
{{ "%.1f"|format(error / total * 100) if total else 0 }}%

通过率

耗时分布

历史趋势

用例详情
{% for case in cases %} {% endfor %}
# 用例名称 描述 类型 状态 耗时 操作
{{ loop.index }}
{{ case.name }}
{{ case.module | friendly_module }}
{{ case.desc }} {% if 'scenario' in case.markers %} 场景 {% else %} 单接口 {% endif %} {{ case.status }} {{ "%.3f"|format(case.duration) }}s
{% if case.setup_stdout %}
前置步骤 (Setup)
SETUP
{{ case.setup_stdout }}
{% endif %} {% if case.api_calls %}
API 调用链 ({{ case.api_calls|length }} 个请求)
{% if 'scenario' in case.markers %}
{% for call in case.api_calls %}
{{ call.method }} {{ call.url }} {{ call.status_code }} {{ call.elapsed_ms|int }}ms
{% if call.request_body %}
入参:
{{ call.request_body }}
{% endif %} {% if call.query_params %}
Query:
{{ call.query_params }}
{% endif %} {% if call.response_body %}
返参:
{{ call.response_body }}
{% endif %}
{% endfor %}
{% else %} {% for call in case.api_calls %}
{{ call.method }} {{ call.url }} {{ call.status_code }} {{ call.elapsed_ms|int }}ms
{% if call.request_body %}
入参:
{{ call.request_body }}
{% endif %} {% if call.query_params %}
Query:
{{ call.query_params }}
{% endif %} {% if call.response_body %}
返参:
{{ call.response_body }}
{% endif %}
{% endfor %} {% endif %}
{% endif %} {% if case.assertions %}
断言详情
{% for a in case.assertions %}
{% if a.passed %}✔{% else %}✘{% endif %} {{ a.description }} {% if a.expected is not none %}期望: {{ a.expected }}{% endif %} {% if a.actual is not none %}实际: {{ a.actual }}{% endif %}
{% endfor %}
{% endif %} {% if case.error_message %}
错误信息
{{ case.error_message }}
{% endif %} {% if case.teardown_stdout %}
后置步骤 (Teardown)
TEARDOWN
{{ case.teardown_stdout }}
{% endif %} {% if case.stdout and case.api_calls %}
原始输出 (点击展开)
{{ case.stdout }}
{% elif not case.api_calls and not case.error_message and case.stdout %}
原始输出
{{ case.stdout }}
{% endif %} {% if not case.api_calls and not case.error_message and not case.stdout and not case.assertions and not case.setup_stdout and not case.teardown_stdout %}
无详细数据
{% endif %}
{% if failed_cases %}
失败 / 错误用例 ({{ failed_cases|length }})
{% for case in failed_cases %}
{{ case.status }} {{ case.name }} {{ case.module | friendly_module }}
{% if case.error_message %}
{{ case.error_message }}
{% endif %}
{% endfor %}
{% endif %}
{% if history %}

历史运行数据 ({{ history|length }} 次)

{% for run in history|reverse %}
#{{ history|length - loop.index0 }} {{ run.timestamp }} {{ run.pass_rate }}% {% if loop.first %}最新{% endif %}
总用例 {{ run.total }}
通过率 {{ run.pass_rate }}%
通过 {{ run.passed }}
失败 {{ run.failed }}
跳过 {{ run.skipped }}
错误 {{ run.error }}
耗时 {{ run.duration }}
构建信息 {{ run.build_number or '-' }}
{% endfor %}
{% endif %}