Skip to content

Commit e52ca71

Browse files
committed
Update pytest output
1 parent 722a01e commit e52ca71

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

seleniumbase/plugins/pytest_plugin.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,8 @@ def pytest_collection_finish(session):
16901690
# Print the Dashboard path if at least one test runs.
16911691
sb_config.item_count_untested = sb_config.item_count
16921692
dash_path = os.path.join(os.getcwd(), "dashboard.html")
1693-
star_len = len("Dashboard: ") + len(dash_path)
1693+
dash_url = "file://" + dash_path.replace("\\", "/")
1694+
star_len = len("Dashboard: ") + len(dash_url)
16941695
try:
16951696
terminal_size = os.get_terminal_size().columns
16961697
if terminal_size > 30 and star_len > terminal_size:
@@ -1710,10 +1711,10 @@ def pytest_collection_finish(session):
17101711
and session.config.workerinput["workerid"] == "gw0"
17111712
):
17121713
sys.stderr.write(
1713-
"\nDashboard: %s%s%s\n%s\n" % (c1, dash_path, cr, stars)
1714+
"\nDashboard: %s%s%s\n%s\n" % (c1, dash_url, cr, stars)
17141715
)
17151716
else:
1716-
print("Dashboard: %s%s%s\n%s" % (c1, dash_path, cr, stars))
1717+
print("Dashboard: %s%s%s\n%s" % (c1, dash_url, cr, stars))
17171718

17181719

17191720
def pytest_runtest_setup(item):
@@ -1827,14 +1828,17 @@ def pytest_terminal_summary(terminalreporter):
18271828
):
18281829
# Print link a second time because the first one may be off-screen
18291830
dashboard_file = os.path.join(os.getcwd(), "dashboard.html")
1830-
terminalreporter.write_sep("-", "Dashboard: %s" % dashboard_file)
1831+
dashboard_url = "file://" + dashboard_file.replace("\\", "/")
1832+
terminalreporter.write_sep("-", "Dashboard = %s" % dashboard_url)
18311833
if (
18321834
sb_config._has_exception
18331835
or sb_config.save_screenshot
18341836
or sb_config._has_logs
18351837
):
18361838
# Log files are generated during test failures and Screenshot Mode
1837-
terminalreporter.write_sep("-", "LogPath: %s" % latest_logs_dir)
1839+
terminalreporter.write_sep(
1840+
"-", "Latest Logs dir: %s" % latest_logs_dir
1841+
)
18381842

18391843

18401844
def _perform_pytest_unconfigure_():

0 commit comments

Comments
 (0)