Open rbcavanaugh opened 2 years ago
Unfortunately, PhantomJS (which is what shinytest uses for a headless browser) does not work with Bootstrap 5.
We're currently working on a successor to shinytest which uses headless Chrome.
Ah thanks so much! Makes sense. I am thinking a not-ideal but sufficient for now workaround would be something like:
theme <- function(){
versionNumber = if (isTRUE(getOption("shiny.testmode"))) {
4
} else {
5
}
bslib::bs_theme(bootswatch = "default",
base_font = bslib::font_google("Open Sans"),
heading_font = bslib::font_google("Open Sans"),
version = versionNumber,
`enable-rounded` = FALSE,
`enable-transitions` = F,
primary = "#1665AC"
)
}
Do you have a sense if there would be any concerns testing app functionality using this approach? (not worrying about the UI changes from bootstrap 4 to 5)
@rbcavanaugh It should be fine while ignoring the UI changes
I'm running into this issue while trying to write a test for a shiny app that uses the new bslib::bs_theme(version = 5). The following reprex appears to work perfectly fine. However, when running using shinytest::recordTest(), it returns the following:
This does not occur for
theme = bslib::bs_theme(version = 4)
. Obviously, this is problematic in trying to write a test to make sure the app is on the correct page.thanks!
Created on 2021-11-29 by the reprex package (v2.0.1)
Using: