From 59808325567e9b193faf2c63669fb91d611521f6 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 20 Jun 2023 16:27:18 +0200 Subject: [PATCH] debug: log all browser js messages --- solara/test/pytest_plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/solara/test/pytest_plugin.py b/solara/test/pytest_plugin.py index c242ee585..fa84c68f9 100644 --- a/solara/test/pytest_plugin.py +++ b/solara/test/pytest_plugin.py @@ -123,6 +123,12 @@ def context_session( @pytest.fixture(scope="session") def page_session(context_session: "playwright.sync_api.BrowserContext"): page = context_session.new_page() + + def log(msg): + print("PAGE LOG:", msg.text) # noqa + logger.debug("PAGE LOG: %s", msg.text) + + page.on("console", log) yield page page.close()