You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When not connected to internet (or when behind a proxy) tests cannot run because app$expect_values() returns an error. The error comes from app_httr_get:
library(shiny)
library(shinytest2)
#> Loading required package: testthatui<- fluidPage(
textInput("name", "What is your name?"),
actionButton("greet", "Greet"),
textOutput("greeting")
)
server<-function(input, output, session) {
output$greeting<- renderText({
req(input$greet)
paste0("Hello ", isolate(input$name), "!")
})
}
shiny_app<- shinyApp(ui, server)
app<-AppDriver$new(shiny_app)
app$set_inputs(name="Hugo")
app$click("greet")
app$expect_values()
#> Error in `app_httr_get()`:#> ! Could not find Shiny server. Shiny app is no longer running#> Backtrace:#> ▆#> 1. └─app$expect_values()#> 2. └─shinytest2:::app_expect_values(...)#> 3. └─shinytest2:::app_httr_get(...)#> 4. └─shinytest2:::app_abort(self, private, "Could not find Shiny server. Shiny app is no longer running")#> 5. └─rlang::abort(..., app = self, call = call)
And this is actually due to the call to pingr::is_up to check if the server is running. By the default, pingr::is_up checks first if the computer is online (check_online = TRUE).
In my case, since I work behind a proxy, this means I cannot use shinytest2 at all. So shouldn't be pingr::is_up called with check_online = FALSE to prevent this situation?
I can create a pull request if needed.
Thanks for the great package!
(Edited to include reprex)
The text was updated successfully, but these errors were encountered:
When not connected to internet (or when behind a proxy) tests cannot run because
app$expect_values()
returns an error. The error comes fromapp_httr_get
:Created on 2023-07-11 with reprex v2.0.2
And this is actually due to the call to
pingr::is_up
to check if the server is running. By the default,pingr::is_up
checks first if the computer is online (check_online = TRUE
).In my case, since I work behind a proxy, this means I cannot use shinytest2 at all. So shouldn't be
pingr::is_up
called withcheck_online = FALSE
to prevent this situation?I can create a pull request if needed.
Thanks for the great package!
(Edited to include reprex)
The text was updated successfully, but these errors were encountered: