diff --git a/tests/testthat/test-shinytest2-tm_t_events.R b/tests/testthat/test-shinytest2-tm_t_events.R index db1e1f8a4..7a85fda3b 100644 --- a/tests/testthat/test-shinytest2-tm_t_events.R +++ b/tests/testthat/test-shinytest2-tm_t_events.R @@ -59,7 +59,7 @@ testthat::test_that( app_driver <- app_driver_tm_t_events() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Adverse Event Table" ) testthat::expect_equal( @@ -116,8 +116,9 @@ testthat::test_that("e2e - tm_t_events: Deselection of arm_var throws validation app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() + selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message" testthat::expect_equal( - app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), + app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)), "Please select 1 or 2 treatment variable values" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_events_by_grade.R b/tests/testthat/test-shinytest2-tm_t_events_by_grade.R index b173daef4..5259f2192 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_by_grade.R +++ b/tests/testthat/test-shinytest2-tm_t_events_by_grade.R @@ -71,7 +71,7 @@ testthat::test_that( skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Adverse Events by Grade Table" ) testthat::expect_equal( @@ -129,8 +129,9 @@ testthat::test_that("e2e - tm_t_events_by_grade: Deselection of arm_var throws v app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() + selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message" testthat::expect_equal( - app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), + app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)), "A treatment variable is required" ) app_driver$stop() @@ -232,8 +233,9 @@ testthat::test_that("e2e - tm_t_events_by_grade: Deselection of grade throws val app_driver$set_active_module_input("grade-dataset_ADAE_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() + selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message" testthat::expect_equal( - app_driver$get_text(app_driver$namespaces(TRUE)$module("grade-dataset_ADAE_singleextract-select_input .shiny-validation-message")), + app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)), "An event grade is required" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_events_patyear.R b/tests/testthat/test-shinytest2-tm_t_events_patyear.R index b8304533f..33c37f95e 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_patyear.R +++ b/tests/testthat/test-shinytest2-tm_t_events_patyear.R @@ -72,7 +72,7 @@ testthat::test_that( skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "AE Rate Adjusted for Patient-Years At Risk Table" ) testthat::expect_equal( @@ -168,8 +168,9 @@ testthat::test_that("e2e - tm_t_events_patyear: Deselection of arm_var throws va data.frame() ) app_driver$expect_validation_error() + selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message" testthat::expect_equal( - app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), + app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)), "Please select exactly 1 or 2 treatment variables" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_events_summary.R b/tests/testthat/test-shinytest2-tm_t_events_summary.R index be833026b..57df6737f 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_summary.R +++ b/tests/testthat/test-shinytest2-tm_t_events_summary.R @@ -111,7 +111,7 @@ testthat::test_that( skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Adverse Events Summary" ) testthat::expect_equal( @@ -158,8 +158,9 @@ testthat::test_that("e2e - tm_t_events_summary: Deselection of arm_var throws va app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() + selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message" testthat::expect_equal( - app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), + app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)), "Please select exactly 1 or 2 treatment variables" ) app_driver$stop()