Skip to content

Commit f555204

Browse files
authored
Vbump rtables to get BS5 fix + increase timeout to pass integration tests (#316)
## Changes ### 1. vbump `rtables` The `rtables::build_table` causes error when using `rtables` version older than `0.6.8`. However, I'm bumping it further to `0.6.12` because it has a BS5 related [fix](insightsengineering/rtables#1014). I will retrigger the integration tests once this is merged. ```r df1 <- data.frame( AGE = c(35, 41), SEX = factor(c("M", "F")), ARM = c("B: Placebo", "C: Combination") ) l1 <- rtables::basic_table() l2 <- rtables::split_cols_by(l1, "ARM") l3 <- rtables::analyze(l2, c("SEX", "AGE")) tbl <- rtables::build_table(l3, df1) tbl ``` ### 2. Increase timeout To reproduce the integration test failure please remove the `app_driver$wait_for_idle(timeout = longer_timeout)` and run the tests to see some inconsistency. I suspect that increasing the timeout would help us pass tests more consistently. ### 3. Remove test for deprecated function `nested_closeable_modal` is deprecated and will be removed in a future release. We do not plan to update this function before that happens, So, the test is redundant now, we already know it works. This is just increasing the testing time and nothing else.
1 parent 8315977 commit f555204

File tree

3 files changed

+23
-64
lines changed

3 files changed

+23
-64
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Imports:
3030
htmltools (>= 0.5.4),
3131
lifecycle (>= 0.2.0),
3232
methods,
33-
rtables (>= 0.6.6),
33+
rtables (>= 0.6.12),
3434
shiny (>= 1.8.1),
3535
shinyjs (>= 2.1.0),
3636
shinyWidgets (>= 0.5.1),

tests/testthat/test-nested_closeable_modal_ui.R

Lines changed: 0 additions & 43 deletions
This file was deleted.

tests/testthat/test-table_with_settings_ui.R

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ app_driver_tws <- function() {
3030
)
3131
}
3232

33+
longer_timeout <- 80000
34+
3335
# nolint start
3436
# JS code to click the expand button popup.
3537
click_expand_popup <- "document.querySelector('#table_with_settings-table-with-settings > bslib-tooltip > button').click()"
@@ -72,7 +74,7 @@ testthat::test_that(
7274
name = "tws",
7375
variant = "app_driver_tws_ui",
7476
)
75-
app_driver$wait_for_idle(timeout = default_idle_timeout)
77+
app_driver$wait_for_idle(timeout = longer_timeout)
7678

7779
# Check if there is an table.
7880
testthat::expect_true(is_visible("#table_with_settings-table_out_main .rtables-container", app_driver))
@@ -94,14 +96,14 @@ testthat::test_that(
9496
name = "tws",
9597
variant = "app_driver_tws_ui",
9698
)
97-
app_driver$wait_for_idle(timeout = default_idle_timeout)
99+
app_driver$wait_for_idle(timeout = longer_timeout)
98100

99101
testthat::expect_false(is_visible("#table_with_settings-downbutton-data_download", app_driver))
100102
testthat::expect_false(is_visible("#table_with_settings-downbutton-file_format", app_driver))
101103
testthat::expect_false(is_visible("#table_with_settings-downbutton-file_name", app_driver))
102104

103105
app_driver$run_js(click_download_popup)
104-
app_driver$wait_for_idle(timeout = default_idle_timeout)
106+
app_driver$wait_for_idle(timeout = longer_timeout)
105107

106108
testthat::expect_equal(
107109
app_driver$get_text("#table_with_settings-downbutton-file_format-label"),
@@ -158,17 +160,17 @@ testthat::test_that(
158160
name = "tws",
159161
variant = "app_driver_tws_ui",
160162
)
161-
app_driver$wait_for_idle(timeout = default_idle_timeout)
163+
app_driver$wait_for_idle(timeout = longer_timeout)
162164

163165
app_driver$run_js(click_download_popup)
164-
app_driver$wait_for_idle(timeout = default_idle_timeout)
166+
app_driver$wait_for_idle(timeout = longer_timeout)
165167

166168
pagination_text <- app_driver$get_text(".paginate-ui")
167169
testthat::expect_match(pagination_text, "Paginate table:\n", fixed = TRUE)
168170
testthat::expect_match(pagination_text, "lines / page\n", fixed = TRUE)
169171

170172
app_driver$click(selector = "input[value='.csv']")
171-
app_driver$wait_for_idle(timeout = default_idle_timeout)
173+
app_driver$wait_for_idle(timeout = longer_timeout)
172174

173175
testthat::expect_false(is_visible(".paginate-ui", app_driver))
174176

@@ -185,13 +187,13 @@ testthat::test_that(
185187
name = "tws",
186188
variant = "app_driver_tws_ui",
187189
)
188-
app_driver$wait_for_idle(timeout = default_idle_timeout)
190+
app_driver$wait_for_idle(timeout = longer_timeout)
189191

190192
testthat::expect_false(is_visible("#table_with_settings-table_out_main", app_driver))
191193
testthat::expect_false(is_visible("#bslib-full-screen-overlay", app_driver))
192194

193195
app_driver$run_js(click_expand_popup)
194-
app_driver$wait_for_idle(timeout = default_idle_timeout)
196+
app_driver$wait_for_idle(timeout = longer_timeout)
195197

196198
table_content <- app_driver$get_text("#table_with_settings-table_out_main")
197199

@@ -200,7 +202,7 @@ testthat::test_that(
200202
testthat::expect_true(is_visible("#bslib-full-screen-overlay", app_driver))
201203
# Close modal.
202204
app_driver$run_js("document.querySelector('#bslib-full-screen-overlay .bslib-full-screen-exit').click();")
203-
app_driver$wait_for_idle(timeout = default_idle_timeout)
205+
app_driver$wait_for_idle(timeout = longer_timeout)
204206
testthat::expect_false(is_visible("#bslib-full-screen-overlay", app_driver))
205207

206208
# Review the main table content.
@@ -221,12 +223,12 @@ testthat::test_that(
221223
name = "tws",
222224
variant = "app_driver_tws_ui",
223225
)
224-
app_driver$wait_for_idle(timeout = default_idle_timeout)
226+
app_driver$wait_for_idle(timeout = longer_timeout)
225227

226228
app_driver$run_js(click_expand_popup)
227-
app_driver$wait_for_idle(timeout = default_idle_timeout)
229+
app_driver$wait_for_idle(timeout = longer_timeout)
228230
app_driver$run_js(click_download_popup)
229-
app_driver$wait_for_idle(timeout = default_idle_timeout)
231+
app_driver$wait_for_idle(timeout = longer_timeout)
230232

231233
testthat::expect_equal(
232234
app_driver$get_text("#table_with_settings-downbutton-file_format-label"),
@@ -287,12 +289,12 @@ testthat::test_that(
287289
name = "tws",
288290
variant = "app_driver_tws_ui",
289291
)
290-
app_driver$wait_for_idle(timeout = default_idle_timeout)
292+
app_driver$wait_for_idle(timeout = longer_timeout)
291293

292294
app_driver$run_js(click_expand_popup)
293-
app_driver$wait_for_idle(timeout = default_idle_timeout)
295+
app_driver$wait_for_idle(timeout = longer_timeout)
294296
app_driver$run_js(click_download_popup)
295-
app_driver$wait_for_idle(timeout = default_idle_timeout)
297+
app_driver$wait_for_idle(timeout = longer_timeout)
296298

297299
pagination_text <- app_driver$get_text(".paginate-ui")
298300
testthat::expect_match(pagination_text, "Paginate table:\n", fixed = TRUE)
@@ -311,10 +313,10 @@ testthat::test_that(
311313
name = "tws",
312314
variant = "app_driver_tws_ui",
313315
)
314-
app_driver$wait_for_idle(timeout = default_idle_timeout)
316+
app_driver$wait_for_idle(timeout = longer_timeout)
315317

316318
app_driver$run_js(click_download_popup)
317-
app_driver$wait_for_idle(timeout = default_idle_timeout)
319+
app_driver$wait_for_idle(timeout = longer_timeout)
318320

319321
filename <- app_driver$get_download("table_with_settings-downbutton-data_download")
320322
testthat::expect_match(filename, "txt$", fixed = FALSE)
@@ -334,13 +336,13 @@ testthat::test_that("e2e teal.widgets::table_with_settings: expanded table can b
334336
name = "tws",
335337
variant = "app_driver_tws_ui",
336338
)
337-
app_driver$wait_for_idle(timeout = default_idle_timeout)
339+
app_driver$wait_for_idle(timeout = longer_timeout)
338340

339341
app_driver$run_js(click_expand_popup)
340-
app_driver$wait_for_idle(timeout = default_idle_timeout)
342+
app_driver$wait_for_idle(timeout = longer_timeout)
341343

342344
app_driver$run_js(click_download_popup)
343-
app_driver$wait_for_idle(timeout = default_idle_timeout)
345+
app_driver$wait_for_idle(timeout = longer_timeout)
344346

345347
filename <- app_driver$get_download("table_with_settings-downbutton-data_download")
346348
testthat::expect_match(filename, "txt$", fixed = FALSE)

0 commit comments

Comments
 (0)