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.browserin the call torunAppto a function that uses thewebdriverpackage 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 theshinytestpackage) - At the end of the
serverfunction, passed toshinyApp, explicitly callstopAppto 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!