Skip to content

Commit c119aa9

Browse files
committed
check for shiny-output-error
1 parent 6d8403c commit c119aa9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/playwright/examples/example_apps.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import PurePath
55
from typing import Literal
66

7-
from playwright.sync_api import ConsoleMessage, Page
7+
from playwright.sync_api import ConsoleMessage, Page, expect
88

99
from shiny.run import ShinyAppProc, run_shiny_app
1010

@@ -15,6 +15,8 @@
1515
reruns = 1 if is_interactive else 3
1616
reruns_delay = 0
1717

18+
SHINY_INIT_TIMEOUT = 30_000
19+
ERROR_ELEMENT_TIMEOUT = 1_000
1820

1921
def get_apps(path: str) -> typing.List[str]:
2022
full_path = pyshiny_root / path
@@ -250,3 +252,8 @@ def on_console_msg(msg: ConsoleMessage) -> None:
250252
+ " had JavaScript console errors!\n"
251253
+ "* ".join(console_errors)
252254
)
255+
256+
# check for shiny output errors
257+
expect(page.locator(".shiny-busy")).to_have_count(0, timeout=SHINY_INIT_TIMEOUT)
258+
error_locator = page.locator(".shiny-output-error")
259+
expect(error_locator).to_have_count(0, timeout=ERROR_ELEMENT_TIMEOUT)

0 commit comments

Comments
 (0)