Skip to content

Commit adb1998

Browse files
committed
Fix the dashboard pie chart on html reports for path changes
1 parent 7fb3585 commit adb1998

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

seleniumbase/plugins/pytest_plugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,13 @@ def pytest_unconfigure():
935935
with open(html_report_path, 'r', encoding='utf-8') as f:
936936
the_html_r = f.read()
937937
if sb_config._saved_dashboard_pie:
938+
h_r_name = sb_config._html_report_name
939+
if "/" in h_r_name and h_r_name.endswith(".html"):
940+
h_r_name = h_r_name.split('/')[-1]
941+
elif "\\" in h_r_name and h_r_name.endswith(".html"):
942+
h_r_name = h_r_name.split('\\')[-1]
938943
the_html_r = the_html_r.replace(
939-
"<h1>%s</h1>" % sb_config._html_report_name,
944+
"<h1>%s</h1>" % h_r_name,
940945
sb_config._saved_dashboard_pie)
941946
the_html_r = the_html_r.replace(
942947
"</head>", '</head><link rel="shortcut icon" '

0 commit comments

Comments
 (0)