-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport_template.html
More file actions
94 lines (82 loc) · 2.17 KB
/
report_template.html
File metadata and controls
94 lines (82 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Test Report</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
h1 {
color: #2c3e50;
}
.summary {
background-color: #ecf0f1;
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
}
.summary p {
margin: 5px 0;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th,
td {
border: 1px solid #bdc3c7;
padding: 10px;
text-align: left;
}
th {
background-color: #2c3e50;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
.pass {
color: green;
}
.fail {
color: red;
}
</style>
</head>
<body>
<h1>API Test Report</h1>
<div class="summary">
<p><strong>Timestamp:</strong> {{ timestamp }}</p>
<p><strong>Total Tests:</strong> {{ total_tests }}</p>
<p><strong>Passed Tests:</strong> {{ passed_tests }}</p>
<p><strong>Failed Tests:</strong> {{ failed_tests }}</p>
<p><strong>Success Rate:</strong> {{ "%.2f"|format(success_rate) }}%</p>
</div>
<table>
<tr>
<th>Endpoint</th>
<th>Method</th>
<th>Status Code</th>
<th>Expected Status</th>
<th>Pass</th>
</tr>
{% for result in results %}
<tr>
<td>{{ result.endpoint }}</td>
<td>{{ result.method }}</td>
<td>{{ result.status_code }}</td>
<td>{{ result.expected_status }}</td>
<td class="{{ 'pass' if result.pass else 'fail' }}">{{ 'Pass' if result.pass else 'Fail' }}</td>
</tr>
{% endfor %}
</table>
</body>
</html>