|
4 | 4 | from pathlib import PurePath |
5 | 5 | from typing import Literal |
6 | 6 |
|
7 | | -from playwright.sync_api import ConsoleMessage, Page |
| 7 | +from playwright.sync_api import ConsoleMessage, Page, expect |
8 | 8 |
|
9 | 9 | from shiny.run import ShinyAppProc, run_shiny_app |
10 | 10 |
|
@@ -91,11 +91,20 @@ def get_apps(path: str) -> typing.List[str]: |
91 | 91 | "FutureWarning: use_inf_as_na option is deprecated", |
92 | 92 | "pd.option_context('mode.use_inf_as_na", # continutation of line above, |
93 | 93 | "RuntimeWarning: invalid value encountered in dot", # some groups didn't have enough data points to create a meaningful line |
| 94 | + "DatetimeIndex.format is deprecated and will be removed in a future version. Convert using index.astype(str) or index.map(formatter) instead.", # cufflinks package is using this method |
| 95 | + "Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`", # cufflinks package is using this method |
94 | 96 | ] |
95 | 97 | app_allow_js_errors: typing.Dict[str, typing.List[str]] = { |
96 | 98 | "examples/brownian": ["Failed to acquire camera feed:"], |
97 | 99 | } |
98 | 100 |
|
| 101 | +# Check for Shiny output errors, except for known exception cases |
| 102 | +app_allow_output_error = [ |
| 103 | + "shiny/api-examples/SafeException/app-express.py", |
| 104 | + "shiny/api-examples/SafeException/app-core.py", |
| 105 | + "examples/global_pyplot/app.py", |
| 106 | +] |
| 107 | + |
99 | 108 |
|
100 | 109 | # Altered from `shinytest2:::app_wait_for_idle()` |
101 | 110 | # https://github.com/rstudio/shinytest2/blob/b8fdce681597e9610fc078aa6e376134c404f3bd/R/app-driver-wait.R |
@@ -251,3 +260,8 @@ def on_console_msg(msg: ConsoleMessage) -> None: |
251 | 260 | + " had JavaScript console errors!\n" |
252 | 261 | + "* ".join(console_errors) |
253 | 262 | ) |
| 263 | + |
| 264 | + if ex_app_path not in app_allow_output_error: |
| 265 | + # Ensure there are no output errors present |
| 266 | + error_locator = page.locator(".shiny-output-error") |
| 267 | + expect(error_locator).to_have_count(0) |
0 commit comments