Creates a shinytest2::AppDriver for app,
which stops when .local_envir exits.
Usage
local_app_driver(
app,
screenshot_args = rlang::missing_arg(),
...,
notifications = FALSE,
.local_envir = parent.frame()
)Arguments
- app
A function without arguments that returns a shiny app, such as
counter_button_appor one fromshinytest2_app_fn(). Other values passed toapp_dirofshinytest2::AppDriver$new()also work.- screenshot_args
Passed to
shinytest2::AppDriver$new(). If you pass it, the driver does not measure testbed modules.- ...
Passed to
shinytest2::AppDriver$new().- notifications
Whether screenshots of testbed modules include notifications (see
shiny::showNotification()), which shiny shows at the bottom right of the window.- .local_envir
The environment whose exit stops the driver.
Details
To make shinytest2 run the working tree of your package,
instead of an outdated installed version,
pass a function as app (see shinytest2_app_fn()).
Screenshots
The driver makes screenshots independent of timing: it shows the end state of transitions and animations, and hides text carets and scrollbars.
Unless you pass screenshot_args,
screenshots of the testbeds module2app() and module2app_bare()
show only the module UI,
with what its elements show outside its own box,
such as open dropdown menus,
but without what scroll containers hide.
They leave out popups that shiny and bslib add to the page body,
such as date pickers, tooltips, popovers and modals.
The driver measures the module in the browser at each screenshot,
so it never calls app in the R process of your tests.
See also
Other shinytest2:
get_screenshot_args_attr(),
module2app_bare_ui(),
shinytest2_app_fn()