Skip to content

Commit 1dfcf07

Browse files
committed
Optimize Dashboard output and favicon display
1 parent 9b918aa commit 1dfcf07

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7769,7 +7769,7 @@ def __process_dashboard(self, has_exception, init=False):
77697769
'<meta property="og:image" '
77707770
'content="https://seleniumbase.io/img/dash_pie.png">'
77717771
'<link rel="shortcut icon" '
7772-
'href="https://seleniumbase.io/img/dash_pie_2.png">'
7772+
'href="https://seleniumbase.io/img/dash_pie.png">'
77737773
'%s'
77747774
'<title>Dashboard</title>'
77757775
'%s</head>' % (auto_refresh_html, style))

seleniumbase/plugins/pytest_plugin.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,13 @@ def pytest_unconfigure():
917917
stamp += "\n<!--Test Run Complete-->"
918918
find_it = constants.Dashboard.META_REFRESH_HTML
919919
swap_with = '' # Stop refreshing the page after the run is done
920+
find_it_2 = "Awaiting results... (Refresh the page for updates)"
921+
swap_with_2 = (
922+
"Test Run ENDED: Some results UNREPORTED due to skipped tearDown!")
923+
find_it_3 = '<td class="col-result">Untested</td>'
924+
swap_with_3 = '<td class="col-result">Unreported</td>'
925+
find_it_4 = 'href="https://seleniumbase.io/img/dash_pie.png"'
926+
swap_with_4 = 'href="https://seleniumbase.io/img/dash_pie_2.png"'
920927
try:
921928
abs_path = os.path.abspath('.')
922929
dashboard_path = os.path.join(abs_path, "dashboard.html")
@@ -927,6 +934,9 @@ def pytest_unconfigure():
927934
the_html_d = f.read()
928935
# If the test run doesn't complete by itself, stop refresh
929936
the_html_d = the_html_d.replace(find_it, swap_with)
937+
the_html_d = the_html_d.replace(find_it_2, swap_with_2)
938+
the_html_d = the_html_d.replace(find_it_3, swap_with_3)
939+
the_html_d = the_html_d.replace(find_it_4, swap_with_4)
930940
the_html_d += stamp
931941
if sb_config._dash_is_html_report and (
932942
sb_config._saved_dashboard_pie):
@@ -935,7 +945,7 @@ def pytest_unconfigure():
935945
sb_config._saved_dashboard_pie)
936946
the_html_d = the_html_d.replace(
937947
"</head>", '</head><link rel="shortcut icon" '
938-
'href="https://seleniumbase.io/img/dash_pie_2.png">')
948+
'href="https://seleniumbase.io/img/dash_pie_3.png">')
939949
if sb_config._dash_final_summary:
940950
the_html_d += sb_config._dash_final_summary
941951
time.sleep(0.1) # Add time for "livejs" to detect changes
@@ -970,7 +980,7 @@ def pytest_unconfigure():
970980
the_html_r = the_html_r.replace(
971981
"</head>", '</head><link rel="shortcut icon" '
972982
'href='
973-
'"https://seleniumbase.io/img/dash_pie_2.png">')
983+
'"https://seleniumbase.io/img/dash_pie_3.png">')
974984
if sb_config._dash_final_summary:
975985
the_html_r += sb_config._dash_final_summary
976986
with open(html_report_path, "w", encoding='utf-8') as f:

0 commit comments

Comments
 (0)