Repository navigation
New features
- New
AppDriver$get_process()returns the background R process that runs the
app. Useapp$get_process()$is_alive()to check if the app is still running,
andapp$get_process()$wait()to wait for an app that calls
shiny::stopApp()to exit before callingapp$stop()(#319, #320, #457).
Bug fixes and minor improvements
-
shinytest2 now requires R 4.1 or later.
-
shinytest2 now requires httr2 1.0.0 or later. Older versions of httr2 could
return aNULLhostname when parsing some app URLs. -
AppDriver$expect_download()andAppDriver$get_download()now build the
download URL correctly when the app URL contains query parameters, instead
of downloading the app's HTML page (#357). They also wait for the download
element'shrefto be set before fetching, so a download link inside a modal
or one that Shiny has not yet rendered now returns the intended file (#445). -
AppDriver$new()now waits for the app's port to accept a connection before
opening the app in the browser. This prevents intermittent "Shiny app did not
become stable" errors on slow machines, where Shiny prints "Listening on ..."
before the port is ready (@nbenn, #448).AppDriver$new()also runs
pkgload::load_all()only on packages in development, so apps tested via
testthat::test_package()now see the installed package's namespace
(@zsigmas, #451). -
record_test()now treats only packages in development, not installed
packages, as the package under test. It also keeps a package's existing
tests/testthat.Rrunner when saving a recorded test (#462). -
vignette("use-package")gains a section, "Apps that read from the global
environment", that shows how to supply test objects to an app that looks them
up in.GlobalEnvby passing a function toAppDriver$new(). A new FAQ entry
explains when an app directory's.Rprofileand.Renvironfiles are run
(#456).