shinytest for an app within a package

First of all, many thanks to @winston, @Gabor, @cpsievert, and others for shinytest. My experience has been super smooth from the start. All I need to know is installDependencies(), recordTest(), and testApp(), and the rest happens pretty much automatically. It's a breeze.

I would like to take the next step and use shinytest to test apps contained inside packages. There is some friction with ordinary package checks, but I hesitate to post an issue because I doubt shinytest was designed for this use case. If anyone has workarounds, please let me know.

My test case is drakeplanner (shinytest branch here). I use shinytest as intended to create some tests in this commit, and then later make some manual changes to try to integrate them with R CMD check. The current errors are available through Travis CI.

1 Like

Hey @wlandau, shinytest should work with testthat. It also seems like it should be possible to use shinytest with a different unit testing system.

From your commit and Travis CI errors, it looks like the offending line is app <- ShinyDriver$new("../")...if you change "../" to point to the shiny app dir that the test script was created for, then that should hopefully fix it.

2 Likes

Oh cool! I will try it out.

@cpsievert, the technique from the vignette worked great. Thanks for sharing.

Ordinary app testing seems to work fine on Linux, but I am having trouble with recordTest() on Mac OS (reprex here).

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.