Hi,
I'm building an R package with a shiny gadget. I'd like to show and manipulate the return value of the gadget in the vignette for demonstration purposes. What would be the best way to accomplish this? I've tried the following so far:
- Set
launch.browser
in the call torunApp
to a function that uses thewebdriver
package to connect to the webpage and programmatically press the 'exit' input button, which is observed and triggersstopApp
. This works the same way as if the user would stop the app manually. (Inspired by theshinytest
package) - At the end of the
server
function, passed toshinyApp
, explicitly callstopApp
to stop the app immediately.
(1) works quite well but requires the user to install phantomjs through webdriver
, which does not seem to play well with some of the build servers. (2) still requires the user to visit the web page in order to trigger a call to the server
function.
Would really appreciate suggestions on how I can either make (1) or (2) work or if there are any better ways to do this!
Thanks!