From 68c58c85e0a8295ff169307380006ea40cc7c602 Mon Sep 17 00:00:00 2001 From: Piotr Pasza Storozenko Date: Mon, 7 Oct 2024 12:30:31 +0000 Subject: [PATCH] tests: refactor startup tests --- tests/playwirght/test_ui.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/playwirght/test_ui.py b/tests/playwirght/test_ui.py index fe40628..bb5e403 100644 --- a/tests/playwirght/test_ui.py +++ b/tests/playwirght/test_ui.py @@ -9,7 +9,7 @@ def test_startup(page: Page, app: ShinyAppProc): """ page.goto(app.url) - # Wait for the page to load fully + # Shiny apps require this wait page.wait_for_load_state("networkidle") # When shiny fails after startup, it adds the #shiny-disconnected-overlay div @@ -17,6 +17,17 @@ def test_startup(page: Page, app: ShinyAppProc): assert not page.query_selector("#shiny-disconnected-overlay"), "The shiny app failed to start" +def test_startup_without_errors(page: Page, app: ShinyAppProc): + """ + Tests if shiny app started without errors. + """ + page.goto(app.url) + + page.wait_for_load_state("networkidle") + + assert not page.query_selector("div.shiny-output-error"), "The shiny app started with errors" + + def test_link_button(page: Page, app: ShinyAppProc): """ Test that the link_button contains the link to the docs.