My app "pfitmap" in https://github.com/erikrikarddaniel/pfitmap-shiny basically works the way I expect, but shinytest (1.0.2, shiny 1.0.0 or 1.0.0.9000, Rstudio 1.0.136) fails to save snapshots. (Note that the app needs an environment variable PFITMAP_DATA set to ../../data/test/classified_proteins.10000.tsv.) Testing the template app "Old Faithful Geyser Data" works for me.
After "Saving baseline..." I get:
Error in session_makeRequest(self, private, endpoint, data, params, headers) :
Unable to find input binding for element
In about half of the cases the element in the function is undefined (I added code to the javascript to print out the "el" variable to find out), in the other cases it's an HTMLDivElement (not printable with JSON.stringify; circular). I don't do any interaction with the app, just start it, press "Take snapshot" and then exit.
In the first case ("el" being undefined), the test script is very short:
app <- ShinyDriver$new("..")
app$snapshotInit("t0")
app$setInputs(mainmatrix_rows_current = c(1, 2, 3, 4))
app$setInputs(mainmatrix_rows_all = c(1, 2, 3, 4))
app$snapshot()
app$snapshotCompare()
In the second ("el" being an HTMLDivElement), more things are set (seemingly a more reasonable case, since I set defaults in my code):
app <- ShinyDriver$new("..")
app$snapshotInit("t1")
app$setInputs(pclasses = character(0))
app$setInputs(tfamilies = character(0))
app$setInputs(torders = character(0))
app$setInputs(pfamilies = character(0))
app$setInputs(tphyla = character(0))
app$setInputs(tgenera = character(0))
app$setInputs(mainmatrix_rows_selected = character(0))
app$setInputs(mainmatrix_rows_current = character(0))
app$setInputs(mainmatrix_rows_all = character(0))
app$setInputs(mainmatrix_state = character(0))
app$setInputs(mainmatrix_search = "")
app$setInputs(mainmatrix_cell_clicked = character(0))
app$setInputs(tclasses = character(0))
app$setInputs(tspecies = character(0))
app$setInputs(mainmatrix_rows_current = c(1, 2, 3, 4))
app$setInputs(mainmatrix_rows_all = c(1, 2, 3, 4))
app$snapshot()
app$snapshotCompare()
I also get warnings for using the same name in inputs and outputs. Changing input names gets rid of the warnings, but doesn't fix the error in writing the snapshot.
I use the DT package for my table, referred to in issue #31.