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:
launch.browserin the call to
runAppto a function that uses the
webdriverpackage to connect to the webpage and programmatically press the 'exit' input button, which is observed and triggers
stopApp. This works the same way as if the user would stop the app manually. (Inspired by the
- At the end of the
serverfunction, passed to
shinyApp, explicitly call
stopAppto 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
Would really appreciate suggestions on how I can either make (1) or (2) work or if there are any better ways to do this!