Package: shinytest2 0.5.1

Barret Schloerke

shinytest2: Testing for Shiny Applications

Automated unit testing of Shiny applications through a headless 'Chromium' browser.

Authors:Barret Schloerke [cre, aut], Posit Software, PBC [cph, fnd], Winston Chang [ctb], Gábor Csárdi [ctb], Hadley Wickham [ctb], Mango Solutions [cph, ccp]

shinytest2_0.5.1.tar.gz
shinytest2_0.5.1.zip(r-4.7)shinytest2_0.5.1.zip(r-4.6)shinytest2_0.5.1.zip(r-4.5)
shinytest2_0.5.1.tgz(r-4.6-x86_64)shinytest2_0.5.1.tgz(r-4.6-arm64)shinytest2_0.5.1.tgz(r-4.5-x86_64)shinytest2_0.5.1.tgz(r-4.5-arm64)
shinytest2_0.5.1.tar.gz(r-4.7-arm64)shinytest2_0.5.1.tar.gz(r-4.7-x86_64)shinytest2_0.5.1.tar.gz(r-4.6-arm64)shinytest2_0.5.1.tar.gz(r-4.6-x86_64)
shinytest2_0.5.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
shinytest2/json (API)

# Install 'shinytest2' in R:
install.packages('shinytest2', repos = c('https://rstudio.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/rstudio/shinytest2/issues

Pkgdown/docs site:https://rstudio.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

cpp

12.41 score 121 stars 1.2k scripts 20k downloads 15 exports 66 dependencies

Last updated from:3844574d93. Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK190
linux-devel-x86_64OK188
source / vignettesOK253
linux-release-arm64OK177
linux-release-x86_64OK167
macos-release-arm64OK142
macos-release-x86_64OK279
macos-oldrel-arm64OK213
macos-oldrel-x86_64OK214
windows-develOK197
windows-releaseOK122
windows-oldrelOK140
wasm-releaseOK216

Exports:AppDrivercompare_screenshot_thresholdget_input_processorsload_app_envload_app_supportlocal_app_supportmigrate_from_shinytestplatform_variantrecord_testregister_input_processorscreenshot_max_differencetest_appuse_shinytest2use_shinytest2_testwith_app_support

Dependencies:AsioHeadersaskpassbackportsbase64encbriobslibcachemcallrcheckmatechromoteclicodetoolscommonmarkcpp11crayoncurldescdiffobjdigestevaluatefastmapfontawesomefsglobalsgluehighrhtmltoolshttpuvhttr2jquerylibjsonliteknitrlaterlifecyclemagrittrmemoisemimeopensslotelpingrpkgbuildpkgloadpraiseprocessxpromisespsR6rappdirsRcpprlangrmarkdownrprojrootsassshinysourcetoolssystestthattinytexvctrswaldowebsocketwithrxfunxtableyamlzip

Getting started with shinytest2
Why test Shiny applications? | How testing works with shinytest2 | Getting started | Recording tests | Running tests | Subsequent test runs | Multiple test scripts | Interactive R Markdown documents | Randomness | One .Rmd file per directory | Prerendered Shiny documents | Next

Last update: 2026-02-25
Started: 2022-03-18

Frequently Asked Questions
What does it mean when I run test_app() and it says, "Server did not update any output values within 3 seconds"? | Some input values are not set right after calling app$set_inputs(). How do I wait for them? | How can my app detect if it's running in {shinytest2}? | How can I get the objects from files in my the R folder into the testing environment? | Can I modify the input and output values that are recorded in snapshots? | Should I manually shut down my AppDriver? | How can I open the test to see if bookmarks are working?

Last update: 2026-02-09
Started: 2022-03-30

Using shinytest2 with R packages
Applications defined in another file | Applications using a function | Application objects | Understanding app support files: local_app_support() and friends | When do you need these functions? | Which function should you use? | Benefits of using these functions | Other setup steps | How should I test multiple applications? | Migrating from shinytest v0.4.0 to v0.5.0 | Continuous integration

Last update: 2026-02-09
Started: 2022-03-30

Auditing Shiny apps
Audit Shiny apps with | Introduction | Load testing with | Launch the background app | Connect Chrome | Replay with shinycannon | Report generation | Automating with GitHub Actions

Last update: 2026-02-09
Started: 2022-09-13

Monkey testing
Monkey (headless) testing with | Initialize the driver | Injecting gremlins.js | Easy way | Local way | Unleash the horde | A bit about gremlins.js | Practice | Blind run | Optimized testing

Last update: 2026-02-09
Started: 2022-03-30

Robust testing
Expectations | Confirm the expected behavior | Assert as little unnecessary information | Write clear, direct tests | {shinytest2} expectations | input/output names | Shiny values: | Downloads | UI expectations | UI visual expectations | Suggested approaches | Exported values | Snapshots vs values | Example | Cliffs Notes | Retrieving values | Expectation methods

Last update: 2026-02-09
Started: 2022-03-30

Testing in depth
Customizing test scripts | Setting inputs with app$set_inputs() and app$click() | Making expectations | Exported values | Adding delays | Controlling random values | Widgets | Tabs | Uploading files | View the headless browser | Getting input, output, and export values | Waiting for an input (or output) value | Dealing with dynamic data | Using variant to expect different snapshots | Limitations | Inputs without input bindings | Input component(s) provided as variable(s) | Next

Last update: 2026-02-09
Started: 2022-03-18

Using shinytest2 with continuous integration
Overview | A repository with a single application | check-app.yaml | renv.lock, renv/activate.R, .Rprofile | Running the first build | A repository with multiple applications | Testing applications in a package | Frequently asked questions | How do I add a status badge to my project? | How do I use a DESCRIPTION file instead of {renv}? | Example workflows

Last update: 2023-10-13
Started: 2022-03-30

Migrating from shinytest
Code structure | Methods | ShinyDriver$click() | ShinyDriver$executeScript() | ShinyDriver$executeScriptAsync() | ShinyDriver$getAllValues() | ShinyDriver$getValue() | ShinyDriver$getUrl() | ShinyDriver$setInputs() | ShinyDriver$getWindowSize(), ShinyDriver$setWindowSize() | ShinyDriver$checkUniqueWidgetNames() | Snapshots | ShinyDriver$snapshotInit() | ShinyDriver$snapshot() | ShinyDriver$takeScreenshot() | ShinyDriver$snapshotDownload() | ShinyDriver$stop() | ShinyDriver$uploadFile() | ShinyDriver$waitFor() | ShinyDriver$waitForShiny() | ShinyDriver$waitForValue() | Elements / Widgets | ShinyDriver$findElement(), ShinyDriver$findElements(), ShinyDriver$findWidget() | ShinyDriver$getSource(), ShinyDriver$getTitle() | Testing setup | ShinyDriver$getRelativePathToApp(), ShinyDriver$getTestsDir() | ShinyDriver$getSnapshotDir() | ShinyDriver$expectUpdate() | Debugging | Other removed methods

Last update: 2022-04-27
Started: 2022-03-30

Readme and manuals

Help Manual

Help pageTopics
Drive a Shiny applicationAppDriver
Compare screenshots given threshold valuecompare_screenshot_threshold screenshot_max_difference
Attach the Shiny application's support environmentload_app_support local_app_support with_app_support
Migrate 'shinytest' testsmigrate_from_shinytest
Platform specific variantplatform_variant
Launch test event recorder for a Shiny apprecord_test
Test Shiny applications with 'testthat'test_app
Use 'shinytest2' with your Shiny applicationuse_shinytest2 use_shinytest2_test