Closed wilfriedmonangeIRSN closed 4 years ago
The menu_home
input is a sidebarMenu()
, not a radioGroupButtons()
.
Is the sidebarMenu()
from shinydashboard?
Sorry, made a mistake in my issue, the command that fail is
> app <- ShinyDriver$new("/xxxxx/")
Warning message:
In check("input", inputs) :
Possible duplicate input widget ids: labsdrop, paramsdrop, filterdrop, codedrop
> app$snapshotInit("LV2_SelPu_Eau_refEau")
> app$setInputs(workshop = "modif")
Error in sd_getAllValues(self, private, input, output, export) :
Unable to fetch all values from server. Is target app running with options(shiny.testmode=TRUE?)
>
Yes sidebarMenu()
comes from shinydashboard.
I'd recommend starting by resolving the warning about duplicate ids.
I fix the warning about duplicate ids (I basically remove the code that make these warnings), but I still get the same error:
> app <- shinytest::ShinyDriver$new("/xxxx/")
> app$snapshotInit("LV2_SelPu_Eau_refEau")
> app$setInputs(workshop = "modif")
Error in sd_getAllValues(self, private, input, output, export) :
Unable to fetch all values from server. Is target app running with options(shiny.testmode=TRUE?)
Finally, I find my error. I exported a value coming from a shiny::validate whose condition was not met:
results <- reactive({
shiny::validate(need(nrow(data$results) > 0, "xxx"))
data$results
})
exportTestValues(results = { results() })
I simply add try
around and everything goes fine now.
exportTestValues(results = { try(results()) })
Hi,
I got an error using shinyWidgets (from https://github.com/dreamRs/shinyWidgets) with the ShinyTest package. My UI part use radioGroupButtons with multiple conditionalPanel as presented below. My app works fine without ShinyTest.
The error I get when I click on the radioGroupButtons is :
Where is my mistake ?
Thanks