View source: R/helper-shinytest2.R
| app_driver_set_teal_picks_slot | R Documentation |
This helper synchronizes native and bootstrap-select state and commits via the teal.picks open/close input pulse. Use this helper only for tests and development workflows.
app_driver_set_teal_picks_slot(app_driver, pick_id, slot, value, wait = TRUE)
app_driver |
App driver object. |
pick_id |
|
slot |
|
value |
|
wait |
|
Invisibly returns app_driver.
## Not run:
if (requireNamespace("shinytest2", quietly = TRUE)) {
data <- within(teal.data::teal_data(), iris <- iris)
test_picks <- picks(
datasets("iris"),
variables(choices = c("Sepal.Length", "Sepal.Width"), selected = "Sepal.Length")
)
teal_app <- teal::init(
data = data,
modules = teal::modules(tm_merge(label = "badge test", picks = list(pick = test_picks)))
)
app_driver <- suppressWarnings(shinytest2::AppDriver$new(
shiny::shinyApp(ui = teal_app$ui, server = teal_app$server)
))
on.exit(app_driver$stop())
app_driver$wait_for_idle()
app_driver_set_teal_picks_slot(app_driver, "pick", "variables", "Sepal.Width")
app_driver_get_teal_picks_slot(app_driver, "pick", "variables")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.