Waits for the Shiny connection and for <html> to lose shiny-busy,
both holding continuously for at least 200ms, including brief busy
transitions. These track Shiny's own busy signal – the same contract
shinytest2 uses. An output suspended on a hidden tab keeps its
.recalculating class until the tab shows, because the server reports
it invalidated but never recomputes it; the wait deliberately does not
inspect per-output recalculating state, so such apps settle.
Details
Idle means Shiny's busy signal has stayed clear; it does not acknowledge
a particular input update or prove an output was delivered or is ready
to capture. Expect the content you rely on (e.g. pz_expect_text())
before reading or capturing it.
A page without the Shiny global errors instead of waiting; a page whose Shiny app never connects times out.
Examples
if (FALSE) { # paparazzi:::examples_run("shiny")
page <- pz_open(pz_example("tasks-app"))
# Clicking Add makes the server re-render the task list, which takes a moment
page |>
pz_set_value("Buy milk", target = "#title") |>
pz_act_click("#add") |>
pz_wait_for_shiny_idle() |>
pz_expect_text("3 tasks", target = "#summary", match = "exact")
pz_get_text(page, target = "#summary")
pz_close(page)
}
