My plan is to set input values and check output values. This looks like an easier approach to testing than shinytest or Selenium. Seems like I "only" need to fill in the ... .
Is this approach feasible at all, or would it involve major changes to shiny internals? I'd appreciate any pointers.
I don't know off-hand the best way to mock the ShinySession object, but I'd look in Shiny to find out. I ran the approach by Joe and he had the following thoughts in Slack:
This almost works. In order to handle the outputs correctly, you potentially need a little more than that.
Some of the output functions (i.e. output$sum(…)) expect additional parameters, like the output name and the session
Some of the outputs like plot outputs expect some other implicit inputs, like width/height/visibility
So to do this right, you really want more official scaffolding. We had a work item to do this for the longest time, but it never made it to the top.
The output also shouldn’t be a list like that, but rather something that creates an observer each time something is assigned to it.
Basically there’s at least a couple of weeks of work to do this right. But yeah, very worthwhile idea.