Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tests/testthat/test-table_with_settings_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ testthat::test_that(
name = "tws",
variant = "app_driver_tws_ui",
)
app_driver$wait_for_idle(timeout = longer_timeout)
app_driver$wait_for_idle(timeout = longer_timeout * 4)

# Check if there is an table.
testthat::expect_true(is_visible("#table_with_settings-table_out_main .rtables-container", app_driver))
Expand Down Expand Up @@ -193,7 +193,17 @@ testthat::test_that(
testthat::expect_false(is_visible("#bslib-full-screen-overlay", app_driver))

app_driver$run_js(click_expand_popup)
app_driver$wait_for_idle(timeout = longer_timeout)

# Wait for table content to be rendered in the modal - poll until content appears
max_attempts <- 10
for (i in seq_len(max_attempts)) {
app_driver$wait_for_idle(timeout = longer_timeout)
table_content <- app_driver$get_text("#table_with_settings-table_out_main")
if (nchar(table_content) > 0 && grepl("B: Placebo|C: Combination", table_content)) {
break
}
Sys.sleep(0.5)
}

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

Expand Down
Loading