Skip to content

Commit

Permalink
Clean up remaining test failures (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert authored Aug 10, 2023
1 parent 0add689 commit c763d55
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion inst/apps/304-bslib-card/tests/testthat/test-shinytest2.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_that("{shinytest2} recording: card", {
view = interactive(),
options = list(bslib.precompiled = FALSE)
)
expect_screenshot <- function(..., wait = 1, viewport = TRUE, threshold = 3) {
expect_screenshot <- function(..., wait = 2, viewport = TRUE, threshold = 3) {
Sys.sleep(wait)
args <- rlang::list2(..., threshold = threshold)
# Make sure the window does not resize when taking screenshots.
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
library(shinytest2)

# Only take screenshots on mac + r-release to reduce diff noise
release <- rversions::r_release()$version
release <- paste0(
strsplit(release, ".", fixed = TRUE)[[1]][1:2],
collapse = "."
)

is_testing_on_ci <- identical(Sys.getenv("CI"), "true") && testthat::is_testing()
is_mac_release <- identical(paste0("mac-", release), platform_variant())

DO_SCREENSHOT <- is_testing_on_ci && is_mac_release


source(system.file("helpers", "keyboard.R", package = "shinycoreci"))

expect_focus <- function(app, selector) {
Expand Down Expand Up @@ -109,9 +96,6 @@ test_that("Can tab focus various cases/options", {
expect_focus(app, "#tip-offset")
expect_visible_tip(app, "#tip-offset")

Sys.sleep(1)
if (DO_SCREENSHOT) app$expect_screenshot()

key_press("Tab")
expect_focus(app, "#tip-animation")
expect_visible_tip(app, "#tip-animation")
Expand Down

0 comments on commit c763d55

Please sign in to comment.