Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rstudio/shinytest2
https://github.com/rstudio/shinytest2
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rstudio/shinytest2
- Owner: rstudio
- License: other
- Created: 2021-07-06T19:41:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T16:56:12.000Z (about 1 month ago)
- Last Synced: 2025-01-06T05:03:32.544Z (5 days ago)
- Language: R
- Homepage: https://rstudio.github.io/shinytest2/
- Size: 19.2 MB
- Stars: 108
- Watchers: 12
- Forks: 19
- Open Issues: 81
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - shinytest2 - Automated unit testing of Shiny apps through a headless Chromium browser. (Developer Tools / Testing)
- jimsghstars - rstudio/shinytest2 - (R)
README
[![CRAN status](https://www.r-pkg.org/badges/version/shinytest2)](https://CRAN.R-project.org/package=shinytest2)
[![R-CMD-check](https://github.com/rstudio/shinytest2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/shinytest2/actions)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![DOI](https://zenodo.org/badge/383580925.svg)](https://zenodo.org/badge/latestdoi/383580925)Manually testing Shiny applications is often laborious, inconsistent, and doesn’t scale well. Whether you are developing new features, fixing bug(s), or simply upgrading dependencies on a serious app where mistakes have real consequences, it is critical to know when regressions are introduced. `{shinytest2}` provides a streamlined toolkit for unit testing Shiny applications and seamlessly integrates with the popular `{testthat}` framework for unit testing R code.
`{shinytest2}` uses `{chromote}` to render applications in a headless Chrome browser. `{chromote}` allows for a live preview, better debugging tools, and/or simply using modern JavaScript/CSS.
By simply recording your actions as code and extending them to test the more particular aspects of your application, it will result in fewer bugs and more confidence in future Shiny application development.
## Installation
```r
# Install the released version from CRAN
install.packages("shinytest2")# Or the development version from GitHub:
# install.packages("devtools")
devtools::install_github("rstudio/shinytest2")
```## Usage
The easiest way to get started is by calling `shinytest2::record_test()` in your app directory. This will open a Shiny application to record your actions as code. To programmatically create a test, call `shinytest2::use_shinytest2_test()`.
Call `shinytest2::use_shinytest2()` to create a initial value test file and set up any other infrastructure you may need.
Please check out our [Getting Started](https://rstudio.github.io/shinytest2/articles/shinytest2.html) article for example usage.