Skip to content

appDriver ignores enableBookmarking argument #379

@gogonzo

Description

@gogonzo

I'm trying to test an app which displays button conditionally depending whether bookmarkStore option is set or not.

library(shiny)

# bookmarkable shiny app
ui <- fluidPage(
  textInput("text", "Text", ""),
  uiOutput("bookmark_button")
)

server <- function(input, output, session) {
  shiny_option <- getShinyOption("bookmarkStore", "disabled")
  print(shiny_option)
  output$bookmark_button <- renderUI({
    if (shiny_option != "disabled") {
      bookmarkButton("Bookmark")
    } else {
      NULL
    }
  })
}

app <- shinyApp(ui, server, enableBookmarking = "url")
  1. The app run normally displays bookmarkButton
app

image

  1. The app run through appDriver doesn't display a button
remdr <- shinytest2::AppDriver$new(app)
browseURL(remdr$get_url())

image


Question:

  • how to force appDriver to use enableBookmarking?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions