Skip to content

Commit

Permalink
Tests wait for idle by default after setting module input (#1200)
Browse files Browse the repository at this point in the history
# Pull Request

<!--- Replace `#nnn` with your issue link for reference. -->

Part of insightsengineering/coredev-tasks#503

### Changes description

- [feature] Wait for app to be idle by default (skips if `wait = FALSE`
parameter is passed)
- [fix] Removes 5s waiting on every `app_driver$click()`
- It was waiting for UI to be stable for 5s, instead of setting the
timeout.
  - Current default timeout is set on constructor at 20s
  • Loading branch information
averissimo authored Apr 11, 2024
1 parent 7e56b9d commit bd60bd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/TealAppDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ TealAppDriver <- R6::R6Class( # nolint: object_name.
#' @param ... arguments passed to parent [`shinytest2::AppDriver`] `click()` method.
click = function(...) {
super$click(...)
self$wait_for_idle(5000)
self$wait_for_idle()
},
#' @description
#' Check if the app has shiny errors. This checks for global shiny errors.
Expand Down Expand Up @@ -232,6 +232,8 @@ TealAppDriver <- R6::R6Class( # nolint: object_name.
value,
...
)
dots <- rlang::list2(...)
if (!isFALSE(dots[[wait]])) self$wait_for_idle() # Default behavior is to wait
invisible(self)
},
#' @description
Expand Down

0 comments on commit bd60bd1

Please sign in to comment.