Cannot handle `shinyWidgets::numericRangeInput`

Open
#376 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
testing-qa

Research direction

Start with the AppDriver$new() examples in the issue and reproduce the failure using shinyWidgets::numericRangeInput or shinyWidgets::demoNumericRange(). Trace the initialization path around the registered sw.numericRange handler and confirm that AppDriver starts without reporting “No handler registered for type mpg:sw.numericRange”.

Written by the indexing model from the issue text.

Description

AppDriver fails at initialization with shinyWidgets::numericRangeInput

Note that the sw.numericRange handler is registered on {shinyWidgets}' .onLoad()

How to reproduce
ui <- shiny::fluidPage(
  shiny::tags$br(),
  shinyWidgets::numericRangeInput(
    inputId = "my_id", label = "Numeric Range Input:",
    value = c(100, 400)
  ),
  shiny::verbatimTextOutput(outputId = "res1")
)

server <- function(input, output, session) {}

app <- shiny::shinyApp(ui, server) |> 
  shinytest2::AppDriver$new(variant = shinytest2::platform_variant())

app$get_logs()

or

app <- shinytest2::AppDriver$new(shinyWidgets::demoNumericRange())
#> Loading required package: shiny
app$get_logs()
#> {shinytest2} R  info   17:17:51.47 Start AppDriver initialization
#> {shinytest2} R  info   17:17:51.72 Starting Shiny app
#> {shinytest2} R  info   17:17:52.16 Creating new ChromoteSession
#> {shinytest2} R  info   17:17:52.96 Navigating to Shiny app
#> {shinytest2} R  info   17:17:53.04 Injecting shiny-tracer.js
#> {chromote}   JS info   17:17:53.06 shinytest2; jQuery not found
#> {chromote}   JS info   17:17:53.06 shinytest2; Loaded
#> {shinytest2} R  info   17:17:53.06 Waiting for Shiny to become ready
#> {chromote}   JS info   17:17:53.13 shinytest2; jQuery found
#> {chromote}   JS info   17:17:53.13 shinytest2; Waiting for shiny session to connect
#> {chromote}   JS info   17:17:53.19 shinytest2; Connected
#> {shinytest2} R  info   17:17:53.27 Waiting for Shiny to become idle for 200ms within 15000ms
#> {chromote}   JS info   17:17:53.27 shinytest2; Waiting for Shiny to be stable
#> {chromote}   JS info   17:17:53.47 shinytest2; Shiny has been idle for 200ms
#> {shinytest2} R  info   17:17:53.47 Shiny app started
#> {shiny}      R  stderr ----------- Loading required package: shiny
#> {shiny}      R  stderr ----------- Running application in test mode.
#> {shiny}      R  stderr ----------- 
#> {shiny}      R  stderr ----------- Listening on http://127.0.0.1:5134
#> {shiny}      R  stderr ----------- Warning: Error in <Anonymous>: No handler registered for type mpg:sw.numericRange
#> {shiny}      R  stderr -----------   14: <Anonymous> [/tmp/RtmpkziAl8/R.INSTALL620331194582/shiny/R/runapp.R#388]
#> {shiny}      R  stderr -----------   12: <Anonymous>
#> {shiny}      R  stderr -----------   11: <Anonymous>
#> {shiny}      R  stderr -----------   10: do.call
#> {shiny}      R  stderr -----------    9: saveRDS
#> {shiny}      R  stderr -----------    8: withCallingHandlers
#> {shiny}      R  stderr -----------    7: doTryCatch
#> {shiny}      R  stderr -----------    6: tryCatchOne
#> {shiny}      R  stderr -----------    5: tryCatchList
#> {shiny}      R  stderr -----------    2: tryCatchList
#> {shiny}      R  stderr -----------    1: tryCatch
#> {shiny}      R  stderr ----------- Error in (function (name, val, shinysession)  : 
#> {shiny}      R  stderr -----------   No handler registered for type mpg:sw.numericRange

Created on 2024-03-13 with reprex v2.0.2

Dominant language
R
Stars
123
Forks
23
Avg merge
3h 13m
Merged PRs (30d)
12

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rstudio/shinytest2

All issues in rstudio/shinytest2

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.