Using shinytest with htmlwidgets DataTables
What is shinytest and Why Should You Care?
At work, I am part of a team that develops and maintains in-house R packages and shiny apps for distributed energy modeling. The ability to easily develop and iterate the modeling code alongside the web app– full-stack analytics development, all in R– allows us to move fast to support our sales engineers as they help create the growing, distributed energy industry.
As our tools have become more business critical, we need to demonstrate that we’re building “production” software. This has always been a chip on the shoulder of every R developer, and is made worse by historic projects at my company, however the R community, strongly led by RStudio, is continuously pushing back on this image with tools designed for robustness. Production software is a series of best-practices and processes, and is not a specific feature of a language.
The shinytest package is a project in active development led by the excellent team at RStudio, with the heaviest contribution from Winston Chang and Gábor Csárdi. It provides a means for automating functional tests for a shiny app and running them with a headless browser (specifically PhantomJS). By adopting automated testing, a developer can feel more confident they are releasing a high-quality, defect-free application.