-
Notifications
You must be signed in to change notification settings - Fork 0
/
12_generate_html_report.py
48 lines (42 loc) · 1.04 KB
/
12_generate_html_report.py
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
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('resources'))
execution_summary = {
"total_number_of_tests": 10,
"passed_tests": 7,
"failed_tests": 3,
"skipped_test": 0
}
test_results = [{
"description": "Test 1",
"run_time": "1.1",
"status": "Passed"
},
{
"description": "Test 2",
"run_time": "1.3",
"status": "Failed"
},
{
"description": "Test 3",
"run_time": "12.1",
"status": "Passed"
},
{
"description": "Test 4",
"run_time": "4.1",
"status": "Failed"
},
]
environment_information = {
"test_env": "test",
"execution_date": "12-12-2024"
}
parameters = {
"title": "Execution Report",
"test_env": "test",
"execution_summary": execution_summary,
"test_results": test_results,
"environment_information": environment_information
}
if __name__ == '__main__':
env.get_template("html_template.html", globals=parameters).stream(name='foo').dump('test_report.html')