diff --git a/DESCRIPTION b/DESCRIPTION index 3c01faa17..ce4534115 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -83,7 +83,8 @@ VignetteBuilder: knitr, rmarkdown Remotes: - insightsengineering/teal, + insightsengineering/teal@bring_tests, + insightsengineering/teal.transform, insightsengineering/teal.reporter Config/Needs/verdepcheck: insightsengineering/teal, insightsengineering/teal.slice, insightsengineering/teal.transform, diff --git a/R/tm_g_barchart_simple.R b/R/tm_g_barchart_simple.R index f8f283bfd..37d16e16a 100644 --- a/R/tm_g_barchart_simple.R +++ b/R/tm_g_barchart_simple.R @@ -747,7 +747,7 @@ make_barchart_simple_call <- function(y_name, if (isTRUE(rotate_y_label)) ggplot2_args$theme[["axis.text.y"]] <- quote(ggplot2::element_text(angle = 45, hjust = 1)) if (!is.null(x_name)) { ggplot2_args$labs[["x"]] <- substitute( - expr = column_annotation_label(counts, x_name), + expr = teal.modules.clinical::column_annotation_label(counts, x_name), env = list(x_name = x_name) ) } else { diff --git a/R/tm_g_km.R b/R/tm_g_km.R index b0a54c401..c1f50bf29 100644 --- a/R/tm_g_km.R +++ b/R/tm_g_km.R @@ -569,7 +569,7 @@ ui_g_km <- function(id, ...) { ) ), bslib::accordion( - open = TRUE, + open = FALSE, bslib::accordion_panel( title = "Additional plot settings", textInput( diff --git a/inst/WORDLIST b/inst/WORDLIST index 0c3e12504..acdbfa402 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -32,3 +32,4 @@ responder responders univariable unstratified +reportable diff --git a/man/tm_a_gee.Rd b/man/tm_a_gee.Rd index 67111f9d3..821246f7b 100644 --- a/man/tm_a_gee.Rd +++ b/man/tm_a_gee.Rd @@ -115,6 +115,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() diff --git a/man/tm_a_mmrm.Rd b/man/tm_a_mmrm.Rd index 7375d451f..c2daa1a5d 100644 --- a/man/tm_a_mmrm.Rd +++ b/man/tm_a_mmrm.Rd @@ -156,6 +156,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ arm_ref_comp <- list( diff --git a/man/tm_g_barchart_simple.Rd b/man/tm_g_barchart_simple.Rd index 93b31f7d9..dbc854bbb 100644 --- a/man/tm_g_barchart_simple.Rd +++ b/man/tm_g_barchart_simple.Rd @@ -97,6 +97,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_ci.Rd b/man/tm_g_ci.Rd index 1630ecaaa..fa5dabad7 100644 --- a/man/tm_g_ci.Rd +++ b/man/tm_g_ci.Rd @@ -96,6 +96,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_forest_rsp.Rd b/man/tm_g_forest_rsp.Rd index 4e3499bee..3c9c23ead 100644 --- a/man/tm_g_forest_rsp.Rd +++ b/man/tm_g_forest_rsp.Rd @@ -159,6 +159,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_forest_tte.Rd b/man/tm_g_forest_tte.Rd index 6d78c639a..21a61dc66 100644 --- a/man/tm_g_forest_tte.Rd +++ b/man/tm_g_forest_tte.Rd @@ -160,6 +160,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_ipp.Rd b/man/tm_g_ipp.Rd index c556bbe3a..07796e937 100644 --- a/man/tm_g_ipp.Rd +++ b/man/tm_g_ipp.Rd @@ -139,6 +139,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_km.Rd b/man/tm_g_km.Rd index 2b2785f46..21301df4e 100644 --- a/man/tm_g_km.Rd +++ b/man/tm_g_km.Rd @@ -158,6 +158,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_lineplot.Rd b/man/tm_g_lineplot.Rd index d7ea20e5f..191db2cf8 100644 --- a/man/tm_g_lineplot.Rd +++ b/man/tm_g_lineplot.Rd @@ -152,6 +152,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_pp_adverse_events.Rd b/man/tm_g_pp_adverse_events.Rd index 80b8570e3..21229eaac 100644 --- a/man/tm_g_pp_adverse_events.Rd +++ b/man/tm_g_pp_adverse_events.Rd @@ -118,6 +118,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_pp_patient_timeline.Rd b/man/tm_g_pp_patient_timeline.Rd index 945d79e18..bad38f69a 100644 --- a/man/tm_g_pp_patient_timeline.Rd +++ b/man/tm_g_pp_patient_timeline.Rd @@ -133,6 +133,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_g_pp_vitals.Rd b/man/tm_g_pp_vitals.Rd index 550daf442..d7caa95ac 100644 --- a/man/tm_g_pp_vitals.Rd +++ b/man/tm_g_pp_vitals.Rd @@ -109,6 +109,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(nestcolor) diff --git a/man/tm_t_abnormality.Rd b/man/tm_t_abnormality.Rd index 005fc6b66..e3c03aeaf 100644 --- a/man/tm_t_abnormality.Rd +++ b/man/tm_t_abnormality.Rd @@ -139,6 +139,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() diff --git a/man/tm_t_abnormality_by_worst_grade.Rd b/man/tm_t_abnormality_by_worst_grade.Rd index d738a9bca..93ae395ed 100644 --- a/man/tm_t_abnormality_by_worst_grade.Rd +++ b/man/tm_t_abnormality_by_worst_grade.Rd @@ -129,6 +129,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(dplyr) diff --git a/man/tm_t_ancova.Rd b/man/tm_t_ancova.Rd index 79ae187a6..212103f43 100644 --- a/man/tm_t_ancova.Rd +++ b/man/tm_t_ancova.Rd @@ -133,6 +133,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_binary_outcome.Rd b/man/tm_t_binary_outcome.Rd index ec3911b8d..142245d7f 100644 --- a/man/tm_t_binary_outcome.Rd +++ b/man/tm_t_binary_outcome.Rd @@ -167,6 +167,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() diff --git a/man/tm_t_coxreg.Rd b/man/tm_t_coxreg.Rd index a8aa8e30c..f6d1de002 100644 --- a/man/tm_t_coxreg.Rd +++ b/man/tm_t_coxreg.Rd @@ -152,6 +152,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ ## First example ## ============= diff --git a/man/tm_t_events.Rd b/man/tm_t_events.Rd index 43b5627b2..abb2f0e21 100644 --- a/man/tm_t_events.Rd +++ b/man/tm_t_events.Rd @@ -134,6 +134,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_events_by_grade.Rd b/man/tm_t_events_by_grade.Rd index bd9643fd1..b5246a9ca 100644 --- a/man/tm_t_events_by_grade.Rd +++ b/man/tm_t_events_by_grade.Rd @@ -126,6 +126,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_events_patyear.Rd b/man/tm_t_events_patyear.Rd index ab18d222c..e05b0d07f 100644 --- a/man/tm_t_events_patyear.Rd +++ b/man/tm_t_events_patyear.Rd @@ -126,6 +126,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(dplyr) diff --git a/man/tm_t_events_summary.Rd b/man/tm_t_events_summary.Rd index 776f18ff7..a371d0699 100644 --- a/man/tm_t_events_summary.Rd +++ b/man/tm_t_events_summary.Rd @@ -151,6 +151,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_exposure.Rd b/man/tm_t_exposure.Rd index 6fe95c30c..79f3f6d13 100644 --- a/man/tm_t_exposure.Rd +++ b/man/tm_t_exposure.Rd @@ -137,6 +137,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(dplyr) diff --git a/man/tm_t_glm_counts.Rd b/man/tm_t_glm_counts.Rd index 62ec68251..73fb6f1c7 100644 --- a/man/tm_t_glm_counts.Rd +++ b/man/tm_t_glm_counts.Rd @@ -121,6 +121,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- within(teal_data(), { ADSL <- tern::tern_ex_adsl diff --git a/man/tm_t_logistic.Rd b/man/tm_t_logistic.Rd index 22cc0a1fe..b37361e6a 100644 --- a/man/tm_t_logistic.Rd +++ b/man/tm_t_logistic.Rd @@ -110,6 +110,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(dplyr) diff --git a/man/tm_t_mult_events.Rd b/man/tm_t_mult_events.Rd index 20ed4e286..2e4c949a3 100644 --- a/man/tm_t_mult_events.Rd +++ b/man/tm_t_mult_events.Rd @@ -122,6 +122,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_pp_basic_info.Rd b/man/tm_t_pp_basic_info.Rd index df8fbff7d..13807270e 100644 --- a/man/tm_t_pp_basic_info.Rd +++ b/man/tm_t_pp_basic_info.Rd @@ -47,6 +47,22 @@ a \code{teal_module} object. \description{ This module produces a patient profile basic info report using ADaM datasets. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_pp_laboratory.Rd b/man/tm_t_pp_laboratory.Rd index 0ff7ae8a4..89adcaf86 100644 --- a/man/tm_t_pp_laboratory.Rd +++ b/man/tm_t_pp_laboratory.Rd @@ -77,6 +77,22 @@ a \code{teal_module} object. \description{ This module produces a patient profile laboratory table using ADaM datasets. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_pp_medical_history.Rd b/man/tm_t_pp_medical_history.Rd index ef30ec98b..cd88cefdb 100644 --- a/man/tm_t_pp_medical_history.Rd +++ b/man/tm_t_pp_medical_history.Rd @@ -85,6 +85,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_pp_prior_medication.Rd b/man/tm_t_pp_prior_medication.Rd index 961343d40..f92b8b48c 100644 --- a/man/tm_t_pp_prior_medication.Rd +++ b/man/tm_t_pp_prior_medication.Rd @@ -62,6 +62,22 @@ a \code{teal_module} object. \description{ This module produces a patient profile prior medication report using ADaM datasets. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ library(dplyr) data <- teal_data() diff --git a/man/tm_t_shift_by_arm.Rd b/man/tm_t_shift_by_arm.Rd index a6e8807a0..31be427c4 100644 --- a/man/tm_t_shift_by_arm.Rd +++ b/man/tm_t_shift_by_arm.Rd @@ -128,6 +128,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_shift_by_arm_by_worst.Rd b/man/tm_t_shift_by_arm_by_worst.Rd index af616c8fa..241138674 100644 --- a/man/tm_t_shift_by_arm_by_worst.Rd +++ b/man/tm_t_shift_by_arm_by_worst.Rd @@ -129,6 +129,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_shift_by_grade.Rd b/man/tm_t_shift_by_grade.Rd index 5e8375668..ac64de94d 100644 --- a/man/tm_t_shift_by_grade.Rd +++ b/man/tm_t_shift_by_grade.Rd @@ -143,6 +143,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_smq.Rd b/man/tm_t_smq.Rd index 02e0ee63a..e09db9c75 100644 --- a/man/tm_t_smq.Rd +++ b/man/tm_t_smq.Rd @@ -128,6 +128,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_summary.Rd b/man/tm_t_summary.Rd index 1c96b0008..0d0f95fcc 100644 --- a/man/tm_t_summary.Rd +++ b/man/tm_t_summary.Rd @@ -124,6 +124,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ # Preparation of the test case - use `EOSDY` and `DCSREAS` variables to demonstrate missing data. data <- teal_data() diff --git a/man/tm_t_summary_by.Rd b/man/tm_t_summary_by.Rd index 7339fcb6e..132ce7ab8 100644 --- a/man/tm_t_summary_by.Rd +++ b/man/tm_t_summary_by.Rd @@ -144,6 +144,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/man/tm_t_tte.Rd b/man/tm_t_tte.Rd index 83bf2e9b4..d417b006e 100644 --- a/man/tm_t_tte.Rd +++ b/man/tm_t_tte.Rd @@ -159,6 +159,22 @@ To learn more please refer to the vignette \code{vignette("transform-module-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } +\section{Reporting}{ + + + +This module returns an object of class \code{teal_module}, that contains a \code{server} function. +Since the server function returns a \code{teal_report} object, this makes this module reportable, which means that +the reporting functionality will be turned on automatically by the \code{teal} framework. + +For more information on reporting in \code{teal}, see the vignettes: +\itemize{ +\item \code{vignette("reportable-shiny-application", package = "teal.reporter")} +\item \code{vignette("adding-support-for-reporting-to-custom-modules", package = "teal")} +} + +} + \examples{ data <- teal_data() data <- within(data, { diff --git a/tests/testthat/test-shinytest2-tm_a_gee.R b/tests/testthat/test-shinytest2-tm_a_gee.R index aa30b9b75..3dd0e9a90 100644 --- a/tests/testthat/test-shinytest2-tm_a_gee.R +++ b/tests/testthat/test-shinytest2-tm_a_gee.R @@ -44,7 +44,6 @@ app_driver_tm_a_gee <- function() { } testthat::test_that("e2e - tm_a_gee: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() @@ -58,12 +57,12 @@ testthat::test_that( "e2e - tm_a_gee: Starts with specified label, id_var, arm_var, visit_var, paramcd, cov_var, conf_level and conf_struct.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() + app_driver$wait_for_idle() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "GEE" ) @@ -100,7 +99,7 @@ testthat::test_that( testthat::expect_equal(app_driver$get_active_module_input("cor_struct"), "unstructured") - radio_buttons <- app_driver$namespaces(TRUE)$module("output_table") + radio_buttons <- app_driver$get_text(app_driver$namespaces(TRUE)$module("output_table")) testthat::expect_match( radio_buttons, "Output Type.*LS means.*Covariance.*Coefficients", @@ -113,7 +112,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_a_gee: Selection of id_var does not change the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -130,21 +128,19 @@ testthat::test_that( ) testthat::test_that("e2e - tm_a_gee: Deselection of id_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() app_driver$set_active_module_input(ns_des_input("id_var", "ADQS", "select"), character(0)) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("id_var-dataset_ADQS_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("id_var-dataset_ADQS_singleextract-select_input > div > span")), "A Subject identifier is required" ) app_driver$stop() }) testthat::test_that("e2e - tm_a_gee: Change in arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() @@ -161,14 +157,13 @@ testthat::test_that("e2e - tm_a_gee: Change in arm_var changes the table and doe }) testthat::test_that("e2e - tm_a_gee: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() app_driver$set_active_module_input(ns_des_input("arm_var", "ADSL", "select"), character(0)) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input > div > span")), "A treatment variable is required" ) app_driver$stop() @@ -177,7 +172,6 @@ testthat::test_that("e2e - tm_a_gee: Deselection of arm_var throws validation er testthat::test_that( "e2e - tm_a_gee: Selection of visit_var does not change the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -194,7 +188,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_a_gee: Deselection of visit_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() app_driver$set_active_module_input(ns_des_input("visit_var", "ADQS", "select"), character(0)) @@ -202,14 +195,13 @@ testthat::test_that("e2e - tm_a_gee: Deselection of visit_var throws validation testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("visit_var-dataset_ADQS_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("visit_var-dataset_ADQS_singleextract-select_input > div > span")), "A visit variable is required" ) app_driver$stop() }) testthat::test_that("e2e - tm_a_gee: Selection of paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -225,21 +217,19 @@ testthat::test_that("e2e - tm_a_gee: Selection of paramcd changes the table and }) testthat::test_that("e2e - tm_a_gee: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() app_driver$set_active_module_input(ns_des_input("paramcd", "ADQS", "filter1-vals"), character(0)) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("paramcd-dataset_ADQS_singleextract-filter1-vals_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("paramcd-dataset_ADQS_singleextract-filter1-vals_input > div > span")), "An endpoint is required" ) app_driver$stop() }) testthat::test_that("e2e - tm_a_gee: Selection of cov_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -255,7 +245,6 @@ testthat::test_that("e2e - tm_a_gee: Selection of cov_var changes the table and }) testthat::test_that("e2e - tm_a_gee: Selection of conf_level changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -271,7 +260,6 @@ testthat::test_that("e2e - tm_a_gee: Selection of conf_level changes the table a }) testthat::test_that("e2e - tm_a_gee: Selection of conf_level out of [0,1] range throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -279,28 +267,26 @@ testthat::test_that("e2e - tm_a_gee: Selection of conf_level out of [0,1] range testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("conf_level_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("conf_level_input > div > span")), "Confidence level must be between 0 and 1" ) app_driver$stop() }) testthat::test_that("e2e - tm_a_gee: Deselection of conf_level throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() app_driver$set_active_module_input("conf_level", character(0)) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("conf_level_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("conf_level_input > div > span")), "Please choose a confidence level" ) app_driver$stop() }) testthat::test_that("e2e - tm_a_gee: Selection of cor_struct changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -316,7 +302,6 @@ testthat::test_that("e2e - tm_a_gee: Selection of cor_struct changes the table a }) testthat::test_that("e2e - tm_a_gee: Deselection of cor_struct does not throw validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() app_driver$set_active_module_input("cor_struct", character(0), wait_ = FALSE) # not waiting because of a warning @@ -325,7 +310,6 @@ testthat::test_that("e2e - tm_a_gee: Deselection of cor_struct does not throw va }) testthat::test_that("e2e - tm_a_gee: Selection of output_table changes the table and doesn't throw validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_gee() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_a_mmrm.R b/tests/testthat/test-shinytest2-tm_a_mmrm.R index c058f1a18..f52514419 100644 --- a/tests/testthat/test-shinytest2-tm_a_mmrm.R +++ b/tests/testthat/test-shinytest2-tm_a_mmrm.R @@ -81,14 +81,13 @@ output_functions <- c( testthat::test_that( "e2e - tm_a_mmrm: Module initializes in teal without errors and displays a message to click 'Fit Model'.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm(FALSE) app_driver$expect_no_shiny_error() app_driver$expect_no_validation_error() - null_text <- app_driver$namespaces(TRUE)$module("null_input_msg") + null_text <- app_driver$get_text(app_driver$namespaces(TRUE)$module("null_input_msg")) testthat::expect_match(null_text, "Please first specify 'Model Settings' and press 'Fit Model'") @@ -101,11 +100,10 @@ testthat::test_that( visit_var, cov_var, arm_var, buckets, combine_comp_arms, id_var, cor_struct, weights_emmeans, conf_level, method, parallel and output_function.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm(FALSE) - testthat::expect_equal(app_driver$get_text("#teal-teal_modules-active_tab .active"), "MMRM") + testthat::expect_equal(app_driver$get_text("a.nav-link.active"), "MMRM") testthat::expect_equal(app_driver$get_active_module_input("aval_var-dataset_ADQS_singleextract-select"), "AVAL") @@ -149,7 +147,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_a_mmrm: Click on fit model shows table for default selection.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() app_driver$expect_no_validation_error() @@ -166,7 +163,6 @@ testthat::test_that( "e2e - tm_a_mmrm: Function t_mmrm_lsmeans selection shows output settings; changing settings throws no validation errors and verify visibility of generated tables.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() @@ -188,7 +184,6 @@ testthat::test_that( "e2e - tm_a_mmrm: Function g_mmrm_lsmeans selection shows output settings; changing settings throws no validation errors and verify visibility of generated plots.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() @@ -198,6 +193,11 @@ testthat::test_that( app_driver$set_active_module_input("output_function", "g_mmrm_lsmeans", wait_ = FALSE) app_driver$expect_no_validation_error() + app_driver$wait_for_idle() + + testthat::expect_true( + app_driver$is_visible(app_driver$namespaces(TRUE)$module("mmrm_plot-plot_main")) + ) plot_before <- app_driver$get_active_module_plot_output("mmrm_plot") testthat::expect_match(plot_before, "data:image/png;base64,") @@ -218,6 +218,7 @@ testthat::test_that( app_driver$set_active_module_input("g_mmrm_lsmeans_contrasts_show_pval", TRUE) app_driver$expect_no_validation_error() + app_driver$wait_for_idle() plot <- app_driver$get_active_module_plot_output("mmrm_plot") testthat::expect_match(plot, "data:image/png;base64,") @@ -231,7 +232,6 @@ testthat::test_that( "e2e - tm_a_mmrm: Function g_mmrm_diagnostic selection shows output settings; changing settings throws no validation errors and verify visibility of generated plots.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() @@ -241,12 +241,18 @@ testthat::test_that( app_driver$set_active_module_input("output_function", "g_mmrm_diagnostic", wait_ = FALSE) app_driver$expect_no_validation_error() + app_driver$wait_for_idle() + + testthat::expect_true( + app_driver$is_visible(app_driver$namespaces(TRUE)$module("mmrm_plot-plot_main")) + ) plot_before <- app_driver$get_active_module_plot_output("mmrm_plot") testthat::expect_match(plot_before, "data:image/png;base64,") app_driver$set_active_module_input("g_mmrm_diagnostic_type", "q-q-residual") app_driver$expect_no_validation_error() + app_driver$wait_for_idle() plot <- app_driver$get_active_module_plot_output("mmrm_plot") testthat::expect_match(plot, "data:image/png;base64,") @@ -263,7 +269,6 @@ for (func in output_functions) { func ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() # Set initial output function @@ -280,12 +285,12 @@ for (func in output_functions) { } testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s .shiny-validation-message", ns_des_input("aval_var", "ADQS", "select_input") ) - ), + )), "Analysis Variable' field is not selected" ) app_driver$expect_validation_error() @@ -299,7 +304,6 @@ for (func in output_functions) { func ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() # Set initial output function @@ -316,12 +320,12 @@ for (func in output_functions) { } testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s .shiny-validation-message", ns_des_input("paramcd", "ADQS", "filter1-vals_input") ) - ), + )), "Select Endpoint' field is not selected" ) app_driver$expect_validation_error() @@ -335,7 +339,6 @@ for (func in output_functions) { func ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() # Set initial output function @@ -352,12 +355,12 @@ for (func in output_functions) { } testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s .shiny-validation-message", ns_des_input("visit_var", "ADQS", "select_input") ) - ), + )), "Visit Variable' field is not selected" ) app_driver$expect_validation_error() @@ -371,7 +374,6 @@ for (func in output_functions) { func ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() # Set initial output function @@ -388,12 +390,12 @@ for (func in output_functions) { } testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s .shiny-validation-message", ns_des_input("arm_var", "ADSL", "select_input") ) - ), + )), "Treatment variable must be selected" ) app_driver$expect_validation_error() @@ -407,7 +409,6 @@ for (func in output_functions) { func ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() # Set initial output function @@ -424,12 +425,12 @@ for (func in output_functions) { } testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s .shiny-validation-message", ns_des_input("id_var", "ADQS", "select_input") ) - ), + )), "Subject Identifier' field is not selected" ) app_driver$expect_validation_error() @@ -443,7 +444,6 @@ for (func in output_functions) { func ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() # Set initial output function @@ -460,12 +460,12 @@ for (func in output_functions) { } testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s .shiny-validation-message", "conf_level_input" ) - ), + )), "Confidence Level' field is not selected" ) app_driver$expect_validation_error() @@ -511,15 +511,18 @@ for (func in output_functions) { func ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_a_mmrm() # Set initial output function app_driver$set_active_module_input("output_function", func, wait_ = FALSE) app_driver$expect_no_validation_error() - + app_driver$wait_for_idle() if (grepl("^g_", func)) { + testthat::expect_true( + app_driver$is_visible(app_driver$namespaces(TRUE)$module("mmrm_plot-plot_main")) + ) + plot_before <- app_driver$get_active_module_plot_output("mmrm_plot") } else { table_before <- app_driver$get_active_module_table_output("mmrm_table-table-with-settings") @@ -538,13 +541,11 @@ for (func in output_functions) { # Check output based on function type (plot or table) if (grepl("^g_", func)) { + plot_after <- app_driver$get_active_module_plot_output("mmrm_plot") testthat::expect_false( - identical( - plot_before, - app_driver$get_active_module_plot_output("mmrm_plot") - ) + identical(plot_before, plot_after) ) - plot_before <- app_driver$get_active_module_plot_output("mmrm_plot") + plot_before <- plot_after } else { testthat::expect_false( identical( diff --git a/tests/testthat/test-shinytest2-tm_g_barchart_simple.R b/tests/testthat/test-shinytest2-tm_g_barchart_simple.R index 0d19eabce..453e75a64 100644 --- a/tests/testthat/test-shinytest2-tm_g_barchart_simple.R +++ b/tests/testthat/test-shinytest2-tm_g_barchart_simple.R @@ -114,17 +114,20 @@ app_driver_tm_g_barchart_simple <- function() { # nolint: object_length. # Initialization -------------------------------------------------------------- testthat::test_that("e2e - tm_g_barchart_simple: Module initializes in teal without errors and produces output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() app_driver$expect_no_shiny_error() app_driver$expect_no_validation_error() - testthat::expect_true( - app_driver$is_visible(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")) + testthat::expect_match( + app_driver$get_active_module_plot_output("myplot"), + "data:image/png;base64," ) - testthat::expect_true(app_driver$is_visible(app_driver$namespaces(TRUE)$module("table"))) + # Table is rendered asynchronously, wait a bit more + app_driver$wait_for_idle() + testthat::expect_true(app_driver$is_visible(app_driver$namespaces(TRUE)$module("table > table"))) app_driver$stop() }) @@ -133,12 +136,12 @@ testthat::test_that( "e2e - tm_g_barchart_simple: Starts with specified label, id_var, arm_var, visit_var, paramcd, cov_var, conf_level and conf_struct.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() testthat::expect_equal( - trimws(app_driver$get_text("#teal-teal_modules-active_tab .active")), + app_driver$get_text("a.nav-link.active"), "ADAE Analysis (e2e)" ) @@ -194,11 +197,12 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_barchart_simple: Selection of 'x' changes the element and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input(ns_des_input("x", "ADSL", "select"), "RACE") + app_driver$wait_for_idle() testthat::expect_false(identical(plot_before, app_driver$get_active_module_plot_output("myplot"))) app_driver$expect_no_validation_error() app_driver$stop() @@ -206,18 +210,18 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_barchart_simple: Deselection of 'x' throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() app_driver$set_active_module_input(ns_des_input("x", "ADSL", "select"), character(0L)) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( - "%s .shiny-validation-message", - ns_des_input("x", "ADSL", "select_input") + "%s_input .shiny-validation-message", + ns_des_input("x", "ADSL", "select") ) - ), + )), "^Please select an x-variable$" ) app_driver$stop() @@ -232,14 +236,18 @@ test_dataset_selection <- function(input_id, new_dataset, new_value) { input_id ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input(sprintf("%s-dataset", input_id), new_dataset) + app_driver$wait_for_idle() testthat::expect_false(identical(plot_before, app_driver$get_active_module_plot_output("myplot"))) testthat::expect_null(app_driver$get_active_module_input(ns_des_input(input_id, new_dataset, "select"))) + # Wait for UI to update with new dataset options before setting value + app_driver$wait_for_idle() app_driver$set_active_module_input(ns_des_input(input_id, new_dataset, "select"), new_value) + app_driver$wait_for_idle() testthat::expect_identical( app_driver$get_active_module_input(ns_des_input(input_id, new_dataset, "select")), new_value @@ -256,11 +264,12 @@ test_dataset_selection <- function(input_id, new_dataset, new_value) { input_id ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input(sprintf("%s-dataset", input_id), character(0L)) + app_driver$wait_for_idle() testthat::expect_null(app_driver$get_active_module_input(input_id)) testthat::expect_false(identical(plot_before, app_driver$get_active_module_plot_output("myplot"))) app_driver$expect_no_validation_error() @@ -282,32 +291,33 @@ for (input_id in c("fill", "x_facet", "y_facet")) { input_id ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() app_driver$set_active_module_input(ns_des_input("x", "ADSL", "select"), "ACTARM", wait_ = FALSE) app_driver$set_active_module_input(sprintf("%s-dataset", input_id), "ADSL", wait_ = FALSE) app_driver$set_active_module_input(ns_des_input(input_id, "ADSL", "select"), "ACTARM") + app_driver$wait_for_idle() app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( - "%s .shiny-validation-message", - ns_des_input("x", "ADSL", "select_input") + "%s_input .shiny-validation-message", + ns_des_input("x", "ADSL", "select") ) - ), + )), "^Duplicated value: ACTARM$" ) testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( - "%s .shiny-validation-message", - ns_des_input(input_id, "ADSL", "select_input") + "%s_input .shiny-validation-message", + ns_des_input(input_id, "ADSL", "select") ) - ), + )), "^Duplicated value: ACTARM$" ) app_driver$stop() @@ -324,12 +334,14 @@ test_that_plot_settings <- function(input_id, new_value, setup_fun = function(ap input_id ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_barchart_simple() + app_driver$wait_for_idle() setup_fun(app_driver) + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input(input_id, new_value) + app_driver$wait_for_idle() testthat::expect_false(identical(plot_before, app_driver$get_active_module_plot_output("myplot"))) app_driver$expect_no_validation_error() app_driver$stop() @@ -351,5 +363,8 @@ test_that_plot_settings("show_n", TRUE) test_that_plot_settings( "rotate_bar_labels", FALSE, - setup_fun = function(app_driver) app_driver$set_active_module_input("label_bars", TRUE) + setup_fun = function(app_driver) { + app_driver$set_active_module_input("label_bars", TRUE) + return(NULL) + } ) diff --git a/tests/testthat/test-shinytest2-tm_g_ci.R b/tests/testthat/test-shinytest2-tm_g_ci.R index c38759e5e..30865c5b1 100644 --- a/tests/testthat/test-shinytest2-tm_g_ci.R +++ b/tests/testthat/test-shinytest2-tm_g_ci.R @@ -74,7 +74,6 @@ app_driver_tm_g_ci <- function() { } testthat::test_that("e2e - tm_g_ci: Module initializes in teal without errors and produces plot output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() app_driver$expect_no_shiny_error() @@ -86,11 +85,10 @@ testthat::test_that("e2e - tm_g_ci: Module initializes in teal without errors an testthat::test_that( "e2e - tm_g_ci: Module initializes with specified label, x_var, y_var, ADLB filters, color, conf_level and stat.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Confidence Interval Plot" ) @@ -142,7 +140,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_ci: Selecting x_var column changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -158,21 +155,19 @@ testthat::test_that("e2e - tm_g_ci: Selecting x_var column changes plot and does }) testthat::test_that("e2e - tm_g_ci: Deselecting x_var column throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() app_driver$set_active_module_input("x_var-dataset_ADSL_singleextract-select", character(0)) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module("x_var-dataset_ADSL_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("x_var-dataset_ADSL_singleextract-select_input > div > span")), "Select a treatment (x axis)" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_ci: Selecting y_var column changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -188,13 +183,12 @@ testthat::test_that("e2e - tm_g_ci: Selecting y_var column changes plot and does }) testthat::test_that("e2e - tm_g_ci: Deselecting y_var column throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() app_driver$set_active_module_input("y_var-dataset_ADLB_singleextract-select", character(0)) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("y_var-dataset_ADLB_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("y_var-dataset_ADLB_singleextract-select_input > div > span")), "Select an analysis value (y axis)" ) app_driver$expect_validation_error() @@ -204,7 +198,6 @@ testthat::test_that("e2e - tm_g_ci: Deselecting y_var column throws validation e testthat::test_that( "e2e - tm_g_ci: Selecting PARAMCD filter value changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -221,13 +214,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_ci: Deselecting PARAMCD filter value throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() app_driver$set_active_module_input("y_var-dataset_ADLB_singleextract-filter1-vals", character(0)) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("y_var-dataset_ADLB_singleextract-filter1-vals_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("y_var-dataset_ADLB_singleextract-filter1-vals_input > div > span")), "Please select the filters." ) app_driver$expect_validation_error() @@ -235,7 +227,6 @@ testthat::test_that("e2e - tm_g_ci: Deselecting PARAMCD filter value throws vali }) testthat::test_that("e2e - tm_g_ci: Selecting AVISIT filter value doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -246,13 +237,12 @@ testthat::test_that("e2e - tm_g_ci: Selecting AVISIT filter value doesn't throw }) testthat::test_that("e2e - tm_g_ci: Deselecting AVISIT filter value throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() app_driver$set_active_module_input("y_var-dataset_ADLB_singleextract-filter2-vals", character(0)) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("y_var-dataset_ADLB_singleextract-filter2-vals_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("y_var-dataset_ADLB_singleextract-filter2-vals_input > div > span")), "Please select the filters." ) app_driver$expect_validation_error() @@ -260,7 +250,6 @@ testthat::test_that("e2e - tm_g_ci: Deselecting AVISIT filter value throws valid }) testthat::test_that("e2e - tm_g_ci: Selecting color column changes plot output and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -271,7 +260,6 @@ testthat::test_that("e2e - tm_g_ci: Selecting color column changes plot output a }) testthat::test_that("e2e - tm_g_ci: Deselecting color column changes plot output and doesn't throw validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -282,7 +270,6 @@ testthat::test_that("e2e - tm_g_ci: Deselecting color column changes plot output }) testthat::test_that("e2e - tm_g_ci: Selecting confidence interval value changes plot and doesn't throw any errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -294,7 +281,6 @@ testthat::test_that("e2e - tm_g_ci: Selecting confidence interval value changes testthat::test_that("e2e - tm_g_ci: Selecting statistic to use changes a plot and doesn't throw any errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ci() plot_before <- app_driver$get_active_module_plot_output("myplot") diff --git a/tests/testthat/test-shinytest2-tm_g_forest_rsp.R b/tests/testthat/test-shinytest2-tm_g_forest_rsp.R index d7ff0f3f5..f105218c3 100644 --- a/tests/testthat/test-shinytest2-tm_g_forest_rsp.R +++ b/tests/testthat/test-shinytest2-tm_g_forest_rsp.R @@ -87,7 +87,6 @@ app_driver_tm_g_forest_rsp <- function() { } testthat::test_that("e2e - tm_g_forest_rsp: Module initializes in teal without errors and produces plot output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() @@ -103,13 +102,12 @@ testthat::test_that( label, arm_var, paramcd, aval_var, responders, subgroup_var, strata_var, conf_level, fixed_symbol_size, rel_width_forest, font_size.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Forest Response" ) @@ -160,7 +158,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_forest_rsp: Selecting arm_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -171,20 +168,18 @@ testthat::test_that("e2e - tm_g_forest_rsp: Selecting arm_var changes plot and d }) testthat::test_that("e2e - tm_g_forest_rsp: Deselecting arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot_out_main"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")), "Treatment variable must be selected" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_forest_rsp: Selecting paramcd changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -195,20 +190,18 @@ testthat::test_that("e2e - tm_g_forest_rsp: Selecting paramcd changes plot and d }) testthat::test_that("e2e - tm_g_forest_rsp: Deselecting paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() app_driver$set_active_module_input("paramcd-dataset_ADRS_singleextract-filter1-vals", NULL) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot_out_main"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")), "Please select Endpoint filter" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_forest_rsp: Selecting responders changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -219,20 +212,18 @@ testthat::test_that("e2e - tm_g_forest_rsp: Selecting responders changes plot an }) testthat::test_that("e2e - tm_g_forest_rsp: Deselecting responders throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() app_driver$set_active_module_input("responders", NULL) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot_out_main"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")), "`Responders` field is empty" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_forest_rsp: Selecting subgroup_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -243,20 +234,18 @@ testthat::test_that("e2e - tm_g_forest_rsp: Selecting subgroup_var changes plot }) testthat::test_that("e2e - tm_g_forest_rsp: Selecting a non-factors column in subgroup_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() app_driver$set_active_module_input("subgroup_var-dataset_ADSL_singleextract-select", c("SEX", "AGE")) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot_out_main"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")), "Not all subgroup variables are factors" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_forest_rsp: Deselecting subgroup_var changes plot and doesn't throw validation errors.", { # nolint: line_length - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -267,7 +256,6 @@ testthat::test_that("e2e - tm_g_forest_rsp: Deselecting subgroup_var changes plo }) testthat::test_that("e2e - tm_g_forest_rsp: Selecting strata_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -278,7 +266,6 @@ testthat::test_that("e2e - tm_g_forest_rsp: Selecting strata_var changes plot an }) testthat::test_that("e2e - tm_g_forest_rsp: Deselecting strata_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -289,7 +276,6 @@ testthat::test_that("e2e - tm_g_forest_rsp: Deselecting strata_var changes plot }) testthat::test_that("e2e - tm_g_forest_rsp: Selecting conf_level changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -300,26 +286,24 @@ testthat::test_that("e2e - tm_g_forest_rsp: Selecting conf_level changes plot an }) testthat::test_that("e2e - tm_g_forest_rsp: Deselecting conf_level or selecting outside the range of 0-1 throws validation error.", { # nolint: line_length - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() app_driver$set_active_module_input("conf_level", NULL) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot_out_main"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")), "Please choose a confidence level between 0 and 1" ) app_driver$set_active_module_input("conf_level", 2) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot_out_main"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")), "Please choose a confidence level between 0 and 1" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_forest_rsp: Unsetting fixed_symbol_size changes plot and doesn't throw validation errors.", { # nolint: line_length - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -330,7 +314,6 @@ testthat::test_that("e2e - tm_g_forest_rsp: Unsetting fixed_symbol_size changes }) testthat::test_that("e2e - tm_g_forest_rsp: Changing rel_width_forest changes plot and doesn't throw validation errors.", { # nolint: line_length - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -341,7 +324,6 @@ testthat::test_that("e2e - tm_g_forest_rsp: Changing rel_width_forest changes pl }) testthat::test_that("e2e - tm_g_forest_rsp: Changing font_size changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_rsp() plot_before <- app_driver$get_active_module_plot_output("myplot") diff --git a/tests/testthat/test-shinytest2-tm_g_forest_tte.R b/tests/testthat/test-shinytest2-tm_g_forest_tte.R index c767d14e6..0568d1e5f 100644 --- a/tests/testthat/test-shinytest2-tm_g_forest_tte.R +++ b/tests/testthat/test-shinytest2-tm_g_forest_tte.R @@ -1,7 +1,7 @@ app_driver_tm_g_forest_tte <- function() { data <- within(teal.data::teal_data(), { ADSL <- teal.modules.clinical::tmc_ex_adsl - ADSL$RACE <- with_label(droplevels(ADSL$RACE), "Race") + ADSL$RACE <- formatters::with_label(droplevels(ADSL$RACE), "Race") ADTTE <- teal.modules.clinical::tmc_ex_adtte }) teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[names(data)] @@ -76,13 +76,13 @@ app_driver_tm_g_forest_tte <- function() { # Initialization -------------------------------------------------------------- testthat::test_that("e2e - tm_g_forest_tte: Module initializes in teal without errors and produces output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() app_driver$expect_no_shiny_error() app_driver$expect_no_validation_error() + app_driver$wait_for_idle() testthat::expect_true( - app_driver$is_visible(app_driver$namespaces(TRUE)$module("myplot-plot_out_main")) + app_driver$is_visible(app_driver$namespaces(TRUE)$module("myplot-plot_main")) ) app_driver$stop() @@ -92,12 +92,11 @@ testthat::test_that( "e2e - tm_g_forest_tte: Starts with specified label, paramcd, arm_var, buckets, paramcd, subgroup_var, strata_var and plot settings.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() testthat::expect_identical( - trimws(app_driver$get_text("#teal-teal_modules-active_tab .active")), + app_driver$get_text("a.nav-link.active"), "Forest Survival (e2e)" ) @@ -151,7 +150,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_forest_tte: Selection of 'paramcd' changes the element and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -163,19 +161,18 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_forest_tte: Deselection of paramcd filter throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() input_id <- ns_des_input("paramcd", "ADTTE", "filter1-vals") app_driver$set_active_module_input(input_id, character(0L)) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s_input .shiny-validation-message", input_id ) - ), + )), "Please select Endpoint filter." ) app_driver$stop() @@ -184,7 +181,6 @@ testthat::test_that("e2e - tm_g_forest_tte: Deselection of paramcd filter throws testthat::test_that( "e2e - tm_g_forest_tte: Selection of 'arm_var' changes the element and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -196,19 +192,18 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_forest_tte: Deselection of paramcd var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() input_id <- ns_des_input("arm_var", "ADSL", "select") app_driver$set_active_module_input(input_id, character(0L)) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s_input .shiny-validation-message", input_id ) - ), + )), "Treatment variable must be selected" ) app_driver$stop() @@ -217,7 +212,6 @@ testthat::test_that("e2e - tm_g_forest_tte: Deselection of paramcd var throws va testthat::test_that( "e2e - tm_g_forest_tte: Selecting conf_level does not throw validation errors and changes a plot.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() input_id <- "conf_level" @@ -226,9 +220,9 @@ testthat::test_that( testthat::expect_false(identical(plot_before, app_driver$get_active_module_plot_output("myplot"))) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf("%s_input .shiny-validation-message", input_id) - ), + )), "Please choose a confidence level" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_g_ipp.R b/tests/testthat/test-shinytest2-tm_g_ipp.R index 8055c0d07..5142e4dc5 100644 --- a/tests/testthat/test-shinytest2-tm_g_ipp.R +++ b/tests/testthat/test-shinytest2-tm_g_ipp.R @@ -65,7 +65,6 @@ app_driver_tm_g_ipp <- function() { } testthat::test_that("e2e - tm_g_ipp: Module initializes in teal without errors and produces plot output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() app_driver$expect_no_shiny_error() @@ -82,11 +81,10 @@ testthat::test_that( label, parentname, arm_var, paramcd, id_var, visit_var, aval_var, avalu_var, baseline_var add_baseline_hline, separate_by_obs, suppress_legend, add_avalu.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Individual Patient Plot" ) testthat::expect_equal( @@ -134,7 +132,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_ipp: Selecting arm_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -150,13 +147,12 @@ testthat::test_that("e2e - tm_g_ipp: Selecting arm_var changes plot and doesn't }) testthat::test_that("e2e - tm_g_ipp: Deselecting arm_var column throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-filter1-vals_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-filter1-vals_input > div > span")), "Please select Arm filter." ) app_driver$expect_validation_error() @@ -164,7 +160,6 @@ testthat::test_that("e2e - tm_g_ipp: Deselecting arm_var column throws validatio }) testthat::test_that("e2e - tm_g_ipp: Selecting paramcd changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -180,13 +175,12 @@ testthat::test_that("e2e - tm_g_ipp: Selecting paramcd changes plot and doesn't }) testthat::test_that("e2e - tm_g_ipp: Deselecting paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() app_driver$set_active_module_input("paramcd-dataset_ADLB_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("paramcd-dataset_ADLB_singleextract-filter1-vals_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("paramcd-dataset_ADLB_singleextract-filter1-vals_input > div > span")), "Please select Parameter filter." ) app_driver$expect_validation_error() @@ -194,7 +188,6 @@ testthat::test_that("e2e - tm_g_ipp: Deselecting paramcd throws validation error }) testthat::test_that("e2e - tm_g_ipp: Selecting visit_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -210,13 +203,12 @@ testthat::test_that("e2e - tm_g_ipp: Selecting visit_var changes plot and doesn' }) testthat::test_that("e2e - tm_g_ipp: Deselecting visit_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() app_driver$set_active_module_input("visit_var-dataset_ADLB_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("visit_var-dataset_ADLB_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("visit_var-dataset_ADLB_singleextract-select_input > div > span")), "A Timepoint Variable must be selected" ) app_driver$expect_validation_error() @@ -224,7 +216,6 @@ testthat::test_that("e2e - tm_g_ipp: Deselecting visit_var throws validation err }) testthat::test_that("e2e - tm_g_ipp: Selecting aval_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -240,13 +231,12 @@ testthat::test_that("e2e - tm_g_ipp: Selecting aval_var changes plot and doesn't }) testthat::test_that("e2e - tm_g_ipp: Deselecting aval_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() app_driver$set_active_module_input("aval_var-dataset_ADLB_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("aval_var-dataset_ADLB_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aval_var-dataset_ADLB_singleextract-select_input > div > span")), "A Parameter values over Time must be selected" ) app_driver$expect_validation_error() @@ -254,7 +244,6 @@ testthat::test_that("e2e - tm_g_ipp: Deselecting aval_var throws validation erro }) testthat::test_that("e2e - tm_g_ipp: Changing add_baseline_hline changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -269,7 +258,6 @@ testthat::test_that("e2e - tm_g_ipp: Changing add_baseline_hline changes plot an app_driver$stop() }) testthat::test_that("e2e - tm_g_ipp: Changing separate_by_obs changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -285,7 +273,6 @@ testthat::test_that("e2e - tm_g_ipp: Changing separate_by_obs changes plot and d }) testthat::test_that("e2e - tm_g_ipp: Changing suppress_legend changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -301,7 +288,6 @@ testthat::test_that("e2e - tm_g_ipp: Changing suppress_legend changes plot and d }) testthat::test_that("e2e - tm_g_ipp: Changing add_avalu changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() plot_before <- app_driver$get_active_module_plot_output("myplot") diff --git a/tests/testthat/test-shinytest2-tm_g_km.R b/tests/testthat/test-shinytest2-tm_g_km.R index a20fb0f11..28d50caad 100644 --- a/tests/testthat/test-shinytest2-tm_g_km.R +++ b/tests/testthat/test-shinytest2-tm_g_km.R @@ -78,7 +78,6 @@ app_driver_tm_g_km <- function() { } testthat::test_that("e2e - tm_g_km: Module initializes in teal without errors and produces plot output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$expect_no_shiny_error() @@ -94,12 +93,11 @@ testthat::test_that("e2e - tm_g_km: Module initializes in teal without errors an testthat::test_that( "e2e - tm_g_km: Starts with specified paramcd, aval_var, cnsr_var, facet_var, arm_var, compare_arms, strata_var.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Kaplan-Meier Plot" ) @@ -138,7 +136,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_km: Changing {paramcd} changes the plot without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -149,7 +146,6 @@ testthat::test_that("e2e - tm_g_km: Changing {paramcd} changes the plot without }) testthat::test_that("e2e - tm_g_km: Changing {facet_var} changes the plot without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -160,7 +156,6 @@ testthat::test_that("e2e - tm_g_km: Changing {facet_var} changes the plot withou }) testthat::test_that("e2e - tm_g_km: Changing {arm_var} changes the plot without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -171,7 +166,6 @@ testthat::test_that("e2e - tm_g_km: Changing {arm_var} changes the plot without }) testthat::test_that("e2e - tm_g_km: Changing {compare_arms} changes the plot without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -182,7 +176,6 @@ testthat::test_that("e2e - tm_g_km: Changing {compare_arms} changes the plot wit }) testthat::test_that("e2e - tm_g_km: Changing {strata_var} changes the plot without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -193,41 +186,38 @@ testthat::test_that("e2e - tm_g_km: Changing {strata_var} changes the plot witho }) testthat::test_that("e2e - tm_g_km: Deselecting {paramcd} throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$set_active_module_input("paramcd-dataset_ADTTE_singleextract-filter1-vals", character(0)) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADTTE_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "An endpoint is required" ) testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot-with-settings"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot-with-settings")), "An endpoint is required" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_km: Deselecting {arm_var} throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$set_active_module_input(ns_des_input("arm_var", "ADSL", "select"), character(0)) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message" - ), + )), "Treatment variable must be selected" ) app_driver$stop() }) testthat::test_that("e2e - tm_g_km: Deselecting {compare_arms} sets it to FALSE.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$set_active_module_input("compare_arms", NULL) @@ -237,7 +227,6 @@ testthat::test_that("e2e - tm_g_km: Deselecting {compare_arms} sets it to FALSE. }) testthat::test_that("e2e - tm_g_km: Deselecting {strata_var} does not throw errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$set_active_module_input(ns_des_input("strata_var", "ADSL", "select"), character(0)) @@ -248,7 +237,6 @@ testthat::test_that("e2e - tm_g_km: Deselecting {strata_var} does not throw erro # groups ---------------------------------------------------------------------------------------------------------- testthat::test_that("e2e - tm_g_km: Starts with specified groups.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() @@ -268,7 +256,6 @@ testthat::test_that("e2e - tm_g_km: Starts with specified groups.", { # comparison settings --------------------------------------------------------------------------------------------- testthat::test_that("e2e - tm_g_km: Starts with specified collapsed comparison settings.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() @@ -277,12 +264,12 @@ testthat::test_that("e2e - tm_g_km: Starts with specified collapsed comparison s testthat::expect_equal(app_driver$get_active_module_input("pval_method_coxph"), "log-rank") testthat::expect_equal( - app_driver$namespaces(TRUE)$module("pval_method_coxph-label"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("pval_method_coxph-label")), "p-value method for Coxph (Hazard Ratio)" ) testthat::expect_equal(app_driver$get_active_module_input("ties_coxph"), "exact") testthat::expect_equal( - app_driver$namespaces(TRUE)$module("ties_coxph-label"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("ties_coxph-label")), "Ties for Coxph (Hazard Ratio)" ) @@ -290,7 +277,6 @@ testthat::test_that("e2e - tm_g_km: Starts with specified collapsed comparison s }) testthat::test_that("e2e - tm_g_km: Changing {pval_method_coxph} changes the plot without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -301,7 +287,6 @@ testthat::test_that("e2e - tm_g_km: Changing {pval_method_coxph} changes the plo }) testthat::test_that("e2e - tm_g_km: Changing {ties_coxph} changes the plot without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -312,7 +297,6 @@ testthat::test_that("e2e - tm_g_km: Changing {ties_coxph} changes the plot witho }) testthat::test_that("e2e - tm_g_km: Deselecting {pval_method_coxph} gives no validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$set_active_module_input("pval_method_coxph", character(0)) @@ -321,7 +305,6 @@ testthat::test_that("e2e - tm_g_km: Deselecting {pval_method_coxph} gives no val }) testthat::test_that("e2e - tm_g_km: Deselecting {ties_coxph} gives no validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$set_active_module_input("ties_coxph", character(0)) @@ -331,8 +314,7 @@ testthat::test_that("e2e - tm_g_km: Deselecting {ties_coxph} gives no validation # plot settings --------------------------------------------------------------------------------------------------- -testthat::test_that("e2e - tm_g_km: Starts with specified collapsed additional plot settings.", { - testthat::skip("chromium") +testthat::test_that("e2e - tm_g_km: Starts with collapsed additional plot settings.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() @@ -356,13 +338,13 @@ testthat::test_that("e2e - tm_g_km: Starts with specified collapsed additional p testthat::expect_equal(app_driver$get_active_module_input("xlab"), "Time") testthat::expect_equal( - app_driver$namespaces(TRUE)$module("xticks-label"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("xticks-label")), "Specify break intervals for x-axis e.g. 0 ; 500" ) - testthat::expect_match(app_driver$namespaces(TRUE)$module("yval-label"), "Value on y-axis", fixed = FALSE) - testthat::expect_equal(app_driver$namespaces(TRUE)$module("font_size-label"), "Table Font Size") - testthat::expect_equal(app_driver$namespaces(TRUE)$module("rel_height_plot-label"), "Relative Height of Plot (%)") - testthat::expect_equal(app_driver$namespaces(TRUE)$module("xlab-label"), "X-axis label") + testthat::expect_match(app_driver$get_text(app_driver$namespaces(TRUE)$module("yval-label")), "Value on y-axis", fixed = FALSE) + testthat::expect_equal(app_driver$get_text(app_driver$namespaces(TRUE)$module("font_size-label")), "Table Font Size") + testthat::expect_equal(app_driver$get_text(app_driver$namespaces(TRUE)$module("rel_height_plot-label")), "Relative Height of Plot (%)") + testthat::expect_equal(app_driver$get_text(app_driver$namespaces(TRUE)$module("xlab-label")), "X-axis label") app_driver$stop() }) @@ -374,7 +356,6 @@ test_that_plot_settings <- function(input_id, new_value) { input_id ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() plot_before <- app_driver$get_active_module_plot_output("myplot") @@ -396,13 +377,12 @@ test_that_plot_settings("conf_level", 0.8) test_that_plot_settings("xlab", "Time2") testthat::test_that("e2e - tm_g_km: Deselecting {conf_level} throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$set_active_module_input("conf_level", -1) app_driver$expect_validation_error() testthat::expect_match( - app_driver$namespaces(TRUE)$module("myplot-plot-with-settings"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("myplot-plot-with-settings")), "Confidence level must be between 0 and 1." ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_g_lineplot.R b/tests/testthat/test-shinytest2-tm_g_lineplot.R index 02d8ae792..ce561b270 100644 --- a/tests/testthat/test-shinytest2-tm_g_lineplot.R +++ b/tests/testthat/test-shinytest2-tm_g_lineplot.R @@ -1,6 +1,7 @@ app_driver_tm_g_lineplot <- function() { data <- within(teal.data::teal_data(), { require(nestcolor) + require(dplyr) ADSL <- teal.modules.clinical::tmc_ex_adsl ADLB <- dplyr::mutate( @@ -64,7 +65,6 @@ app_driver_tm_g_lineplot <- function() { } testthat::test_that("e2e - tm_g_lineplot: Module initializes in teal without errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() @@ -82,12 +82,11 @@ testthat::test_that( "e2e - tm_g_lineplot: Starts with specified label, param, group_var, y, x, mid, interval, incl_screen, plot_settings and table_settings.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() - testthat::expect_equal(trimws(app_driver$get_text("#teal-teal_modules-active_tab .active")), "Line Plot") + testthat::expect_equal(trimws(app_driver$get_text("a.nav-link.active")), "Line Plot") testthat::expect_equal(app_driver$get_active_module_input("param-dataset_ADLB_singleextract-filter1-vals"), "ALT") testthat::expect_equal(app_driver$get_active_module_input("group_var-dataset_ADSL_singleextract-select"), "ARM") testthat::expect_equal(app_driver$get_active_module_input("y-dataset_ADLB_singleextract-select"), "AVAL") @@ -113,29 +112,27 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_lineplot: Selecting param changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input("param-dataset_ADLB_singleextract-filter1-vals", "CRP") + app_driver$wait_for_idle() + plot_after <- app_driver$get_active_module_plot_output("myplot") testthat::expect_false( - identical( - plot_before, - app_driver$get_active_module_plot_output("myplot") - ) + identical(plot_before, plot_after) ) app_driver$expect_no_validation_error() app_driver$stop() }) testthat::test_that("e2e - tm_g_lineplot: Deselecting param throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() app_driver$set_active_module_input("param-dataset_ADLB_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("param-dataset_ADLB_singleextract-filter1-vals_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("param-dataset_ADLB_singleextract-filter1-vals_input > div > span")), "Please select Biomarker filter." ) app_driver$expect_validation_error() @@ -145,16 +142,15 @@ testthat::test_that("e2e - tm_g_lineplot: Deselecting param throws validation er testthat::test_that( "e2e - tm_g_lineplot: Selecting group_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input("group_var-dataset_ADSL_singleextract-select", "ARMCD") + app_driver$wait_for_idle() + plot_after <- app_driver$get_active_module_plot_output("myplot") testthat::expect_false( - identical( - plot_before, - app_driver$get_active_module_plot_output("myplot") - ) + identical(plot_before, plot_after) ) app_driver$expect_no_validation_error() app_driver$stop() @@ -162,15 +158,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_lineplot: Deselecting group_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() app_driver$set_active_module_input("group_var-dataset_ADSL_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "group_var-dataset_ADSL_singleextract-select_input > div > span" - ), + )), "Please select a treatment variable" ) app_driver$expect_validation_error() @@ -178,31 +173,29 @@ testthat::test_that("e2e - tm_g_lineplot: Deselecting group_var throws validatio }) testthat::test_that("e2e - tm_g_lineplot: Selecting y changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input("y-dataset_ADLB_singleextract-select", "BASE") + app_driver$wait_for_idle() + plot_after <- app_driver$get_active_module_plot_output("myplot") testthat::expect_false( - identical( - plot_before, - app_driver$get_active_module_plot_output("myplot") - ) + identical(plot_before, plot_after) ) app_driver$expect_no_validation_error() app_driver$stop() }) testthat::test_that("e2e - tm_g_lineplot: Deselecting y throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() app_driver$set_active_module_input("y-dataset_ADLB_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "y-dataset_ADLB_singleextract-select_input > div > span" - ), + )), "Please select an analysis variable" ) app_driver$expect_validation_error() @@ -210,29 +203,27 @@ testthat::test_that("e2e - tm_g_lineplot: Deselecting y throws validation error. }) testthat::test_that("e2e - tm_g_lineplot: Selecting conf_level changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() + app_driver$wait_for_idle() plot_before <- app_driver$get_active_module_plot_output("myplot") app_driver$set_active_module_input("conf_level", "0.8") + app_driver$wait_for_idle() + plot_after <- app_driver$get_active_module_plot_output("myplot") testthat::expect_false( - identical( - plot_before, - app_driver$get_active_module_plot_output("myplot") - ) + identical(plot_before, plot_after) ) app_driver$expect_no_validation_error() app_driver$stop() }) testthat::test_that("e2e - tm_g_lineplot: Deselecting conf_level validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() app_driver$set_active_module_input("conf_level", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("conf_level_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("conf_level_input > div > span")), "Please choose a confidence level" ) app_driver$expect_validation_error() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R b/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R index 1710eb134..018bcf883 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R @@ -55,7 +55,6 @@ app_driver_tm_g_pp_adverse_events <- function() { # nolint: object_length. testthat::test_that( "e2e tm_g_pp_adverse_events - Module initializes in teal without any errors and produces the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() app_driver$expect_no_shiny_error() @@ -72,11 +71,10 @@ testthat::test_that( "e2e tm_g_pp_adverse_events - Module initializes with specific label, patient_id, aeterm, tox_grade, causality, outcome, action, time, decod.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Adverse Events" ) @@ -126,7 +124,6 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Selecting patient_id doesn't throw errors and changes the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() plot_before <- app_driver$get_active_module_plot_output("chart") @@ -152,14 +149,13 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Deselecting patient_id throw validation error", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() input_id <- "patient_id" - app_driver$set_active_module_input(input_id, "") + app_driver$set_active_module_input(input_id, NULL) app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id)), + app_driver$get_text(app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id))), "Please select a patient" ) app_driver$stop() @@ -169,7 +165,6 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Selecting aeterm column doesn't throw errors and changes the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() plot_before <- app_driver$get_active_module_plot_output("chart") @@ -196,14 +191,13 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Deselecting aeterm column throw validation error", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() input_id <- "aeterm-dataset_ADAE_singleextract-select" app_driver$set_active_module_input(input_id, "") app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id)), + app_driver$get_text(app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id))), "Please select AETERM variable." ) app_driver$stop() @@ -213,7 +207,6 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Selecting tox_grade column doesn't throw errors and changes the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() plot_before <- app_driver$get_active_module_plot_output("chart") @@ -240,14 +233,13 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Deselecting tox_grade column throw validation error", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() input_id <- "tox_grade-dataset_ADAE_singleextract-select" app_driver$set_active_module_input(input_id, "") app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id)), + app_driver$get_text(app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id))), "Please select AETOXGR variable." ) app_driver$stop() @@ -257,7 +249,6 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Selecting causality column doesn't throw errors and changes the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() plot_before <- app_driver$get_active_module_plot_output("chart") @@ -284,14 +275,13 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Deselecting causality column throw validation error", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() input_id <- "causality-dataset_ADAE_singleextract-select" app_driver$set_active_module_input(input_id, "") app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id)), + app_driver$get_text(app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id))), "Please select AEREL variable." ) app_driver$stop() @@ -301,7 +291,6 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Selecting outcome column doesn't throw errors and changes the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() plot_before <- app_driver$get_active_module_plot_output("chart") @@ -328,14 +317,13 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Deselecting outcome column throw validation error", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() input_id <- "outcome-dataset_ADAE_singleextract-select" app_driver$set_active_module_input(input_id, "") app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id)), + app_driver$get_text(app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id))), "Please select AEOUT variable." ) app_driver$stop() @@ -345,7 +333,6 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Selecting action column doesn't throw errors and changes the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() plot_before <- app_driver$get_active_module_plot_output("chart") @@ -372,14 +359,13 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Deselecting action column throw validation error", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() input_id <- "action-dataset_ADAE_singleextract-select" app_driver$set_active_module_input(input_id, "") app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id)), + app_driver$get_text(app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id))), "Please select AEACN variable." ) app_driver$stop() @@ -389,7 +375,6 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Selecting time column doesn't throw errors and changes the plot and table.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() plot_before <- app_driver$get_active_module_plot_output("chart") @@ -416,14 +401,13 @@ testthat::test_that( testthat::test_that( "e2e tm_g_pp_adverse_events - Deselecting time column throw validation error", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() input_id <- "time-dataset_ADAE_singleextract-select" app_driver$set_active_module_input(input_id, "") app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id)), + app_driver$get_text(app_driver$namespaces(TRUE)$module(sprintf("%s_input .shiny-validation-message", input_id))), "Please select ASTDY variable." ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R b/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R index adc77e528..7c2c38245 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R @@ -89,7 +89,6 @@ app_driver_tm_g_pp_patient_timeline <- function() { # nolint object_length. testthat::test_that( "e2e - tm_g_pp_patient_timeline: Module initializes in teal without errors and produces plot output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$expect_no_shiny_error() @@ -108,12 +107,11 @@ testthat::test_that( "e2e - tm_g_pp_patient_timeline: Starts with specified label, patient_id, cmdecod, aeterm, aetime_start, aetime_end, dstime_start, dstime_end, aerelday_start, aerelday_end, dsrelday_start, dsrelday_en.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Patient Timeline" ) testthat::expect_equal( @@ -174,7 +172,6 @@ testthat::test_that( "e2e - tm_g_pp_patient_timeline: Encodings aerelday_start, aerelday_end, dsrelday_start, dsrelday_end are shown only when relday_x_axis is checked.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() @@ -206,7 +203,6 @@ testthat::test_that( "e2e - tm_g_pp_patient_timeline: Encodings aetime_start, aetime_end, dstime_start, dstime_end are shown only when relday_x_axis is unchecked.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() @@ -237,7 +233,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting patient_id changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -254,13 +249,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_pp_patient_timeline: Deselecting patient_id column throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("patient_id", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("patient_timeline_plot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("patient_id_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("patient_id_input > div > span")), "Please select a patient" ) app_driver$expect_validation_error() @@ -270,7 +264,6 @@ testthat::test_that("e2e - tm_g_pp_patient_timeline: Deselecting patient_id colu testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting cmdecod changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -289,7 +282,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting cmdecod changes plot and doesn't throw validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -303,7 +295,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting aeterm changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -322,7 +313,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting aeterm changes plot and doesn't throw validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -336,7 +326,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting aetime_start changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) @@ -356,14 +345,13 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting aetime_start throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) app_driver$set_active_module_input("aetime_start-dataset_ADAE_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("aetime_start-dataset_ADAE_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aetime_start-dataset_ADAE_singleextract-select_input > div > span")), "Please add AE start date." ) app_driver$expect_validation_error() @@ -374,7 +362,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting aetime_end changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) @@ -394,14 +381,13 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting aetime_end throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) app_driver$set_active_module_input("aetime_end-dataset_ADAE_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("aetime_end-dataset_ADAE_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aetime_end-dataset_ADAE_singleextract-select_input > div > span")), "Please add AE end date." ) app_driver$expect_validation_error() @@ -412,7 +398,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting aerelday_start changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -431,13 +416,12 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting aerelday_start throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("aerelday_start-dataset_ADAE_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("aerelday_start-dataset_ADAE_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aerelday_start-dataset_ADAE_singleextract-select_input > div > span")), "Please add AE start date." ) app_driver$expect_validation_error() @@ -448,7 +432,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting aerelday_end changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -467,13 +450,12 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting aerelday_end throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("aerelday_end-dataset_ADAE_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("aerelday_end-dataset_ADAE_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aerelday_end-dataset_ADAE_singleextract-select_input > div > span")), "Please add AE end date." ) app_driver$expect_validation_error() @@ -484,7 +466,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting dstime_start changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) @@ -504,14 +485,13 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting dstime_start throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) app_driver$set_active_module_input("dstime_start-dataset_ADCM_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("dstime_start-dataset_ADCM_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("dstime_start-dataset_ADCM_singleextract-select_input > div > span")), "Please add Medication start date." ) app_driver$expect_validation_error() @@ -522,7 +502,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting dstime_end changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) @@ -542,14 +521,13 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting dstime_end throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("relday_x_axis", FALSE) app_driver$set_active_module_input("dstime_end-dataset_ADCM_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("dstime_end-dataset_ADCM_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("dstime_end-dataset_ADCM_singleextract-select_input > div > span")), "Please add Medication end date." ) app_driver$expect_validation_error() @@ -560,7 +538,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting dsrelday_start changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -579,13 +556,12 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting dsrelday_start throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("dsrelday_start-dataset_ADCM_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("dsrelday_start-dataset_ADCM_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("dsrelday_start-dataset_ADCM_singleextract-select_input > div > span")), "Please add Medication start date." ) app_driver$expect_validation_error() @@ -596,7 +572,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Selecting dsrelday_end changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() plot_before <- app_driver$get_active_module_plot_output("patient_timeline_plot") @@ -615,13 +590,12 @@ testthat::test_that( testthat::test_that( "e2e - tm_g_pp_patient_timeline: Deselecting dsrelday_end throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_patient_timeline() app_driver$set_active_module_input("dsrelday_end-dataset_ADCM_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("myplot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("dsrelday_end-dataset_ADCM_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("dsrelday_end-dataset_ADCM_singleextract-select_input > div > span")), "Please add Medication end date." ) app_driver$expect_validation_error() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_therapy.R b/tests/testthat/test-shinytest2-tm_g_pp_therapy.R index fdce00290..4669b7210 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_therapy.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_therapy.R @@ -89,7 +89,6 @@ app_driver_tm_g_pp_therapy <- function() { # Initialization -------------------------------------------------------------- testthat::test_that("e2e - tm_g_pp_therapy: Module initializes in teal without errors and produces output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_therapy() @@ -97,7 +96,7 @@ testthat::test_that("e2e - tm_g_pp_therapy: Module initializes in teal without e app_driver$expect_no_validation_error() testthat::expect_true( - app_driver$is_visible(app_driver$namespaces(TRUE)$module("therapy_plot-plot_out_main")) + app_driver$is_visible(app_driver$namespaces(TRUE)$module("therapy_plot-plot_main")) ) testthat::expect_true( app_driver$is_visible(app_driver$namespaces(TRUE)$module("therapy_table")) @@ -110,12 +109,11 @@ testthat::test_that( "e2e - tm_g_pp_therapy: Starts with specified label, paramcd, arm_var, buckets, paramcd, subgroup_var, strata_var and plot settings.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_therapy() testthat::expect_equal( - trimws(app_driver$get_text("#teal-teal_modules-active_tab .active")), + trimws(app_driver$get_text("a.nav-link.active")), "Therapy (e2e)" ) @@ -153,12 +151,11 @@ test_different_selection <- function(input_name, input_id, new_value) { input_name ), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_therapy() plot_before <- list( app_driver$get_active_module_plot_output("therapy_plot"), - app_driver$namespaces(TRUE)$module("therapy_table") + app_driver$get_active_module_table_output("therapy_table") ) app_driver$set_active_module_input(input_id, new_value) testthat::expect_false( @@ -166,7 +163,7 @@ test_different_selection <- function(input_name, input_id, new_value) { plot_before, list( app_driver$get_active_module_plot_output("therapy_plot"), - app_driver$namespaces(TRUE)$module("therapy_table") + app_driver$get_active_module_table_output("therapy_table") ) ) ) @@ -190,7 +187,6 @@ test_different_selection("cmendy", ns_des_input("cmendy", "ADCM", "select"), "AE testthat::test_that( "e2e - tm_g_pp_therapy: Changing font_size changes the plot and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_therapy() plot_before <- app_driver$get_active_module_plot_output("therapy_plot") @@ -210,18 +206,17 @@ test_delection_validation <- function(input_name, input_id, deselect_message) { deselect_message <- sprintf("Please select %s variable.", toupper(input_name)) } testthat::test_that(sprintf("e2e - tm_g_pp_therapy: Deselection of %s throws validation error.", input_name), { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_therapy() app_driver$set_active_module_input(input_id, NULL) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( sprintf( "%s_input .shiny-validation-message", input_id ) - ), + )), deselect_message ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_vitals.R b/tests/testthat/test-shinytest2-tm_g_pp_vitals.R index d13bb5a20..5be1d0357 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_vitals.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_vitals.R @@ -36,7 +36,6 @@ app_driver_tm_g_pp_vitals <- function() { } testthat::test_that("e2e - tm_g_pp_vitals: Module initializes in teal without errors and produces plot output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() app_driver$expect_no_shiny_error() @@ -56,12 +55,11 @@ testthat::test_that( "e2e - tm_g_pp_vitals: Starts with specified label, patient_id, paramcd, xaxis, aval_var, font_size, parentname, patient_col.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Vitals" ) testthat::expect_equal( @@ -93,7 +91,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_pp_vitals: Selecting patient_id changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() plot_before <- app_driver$get_active_module_plot_output("vitals_plot") @@ -109,13 +106,12 @@ testthat::test_that("e2e - tm_g_pp_vitals: Selecting patient_id changes plot and }) testthat::test_that("e2e - tm_g_pp_vitals: Deselecting patient_id column throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() app_driver$set_active_module_input("patient_id", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("vitals_plot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("patient_id_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("patient_id_input > div > span")), "Please select a patient." ) app_driver$expect_validation_error() @@ -126,7 +122,6 @@ testthat::test_that( "e2e - tm_g_pp_vitals: Selecting valid paramcd and paramcd_levels_vals changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() plot_before <- app_driver$get_active_module_plot_output("vitals_plot") @@ -137,7 +132,7 @@ testthat::test_that( # Expecting validation error on empty PARAMCD levels input app_driver$expect_validation_error() testthat::expect_identical( - app_driver$namespaces(TRUE)$module("paramcd_levels > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("paramcd_levels > div > span")), "Please select PARAMCD variable levels." ) @@ -163,13 +158,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_g_pp_vitals: Deselecting paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() app_driver$set_active_module_input("paramcd-dataset_ADVS_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("vitals_plot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("paramcd-dataset_ADVS_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("paramcd-dataset_ADVS_singleextract-select_input > div > span")), "Please select PARAMCD variable." ) app_driver$expect_validation_error() @@ -177,7 +171,6 @@ testthat::test_that("e2e - tm_g_pp_vitals: Deselecting paramcd throws validation }) testthat::test_that("e2e - tm_g_pp_vitals: Selecting xaxis changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() plot_before <- app_driver$get_active_module_plot_output("vitals_plot") @@ -193,13 +186,12 @@ testthat::test_that("e2e - tm_g_pp_vitals: Selecting xaxis changes plot and does }) testthat::test_that("e2e - tm_g_pp_vitals: Deselecting xaxis column throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() app_driver$set_active_module_input("xaxis-dataset_ADVS_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("vitals_plot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("xaxis-dataset_ADVS_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("xaxis-dataset_ADVS_singleextract-select_input > div > span")), "Please select Vitals x-axis variable." ) app_driver$expect_validation_error() @@ -207,7 +199,6 @@ testthat::test_that("e2e - tm_g_pp_vitals: Deselecting xaxis column throws valid }) testthat::test_that("e2e - tm_g_pp_vitals: Selecting aval_var changes plot and doesn't throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() plot_before <- app_driver$get_active_module_plot_output("vitals_plot") @@ -223,13 +214,12 @@ testthat::test_that("e2e - tm_g_pp_vitals: Selecting aval_var changes plot and d }) testthat::test_that("e2e - tm_g_pp_vitals: Deselecting aval_var column throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() app_driver$set_active_module_input("aval_var-dataset_ADVS_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_plot_output("vitals_plot"), character(0)) testthat::expect_identical( - app_driver$namespaces(TRUE)$module("aval_var-dataset_ADVS_singleextract-select_input > div > span"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aval_var-dataset_ADVS_singleextract-select_input > div > span")), "Please select AVAL variable." ) app_driver$expect_validation_error() @@ -237,7 +227,6 @@ testthat::test_that("e2e - tm_g_pp_vitals: Deselecting aval_var column throws va }) testthat::test_that("e2e - tm_g_pp_vitals: Changing font_size changes plot and doesn't throw validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_vitals() plot_before <- app_driver$get_active_module_plot_output("vitals_plot") diff --git a/tests/testthat/test-shinytest2-tm_t_abnormality.R b/tests/testthat/test-shinytest2-tm_t_abnormality.R index 4af5871f1..ec62c05ec 100644 --- a/tests/testthat/test-shinytest2-tm_t_abnormality.R +++ b/tests/testthat/test-shinytest2-tm_t_abnormality.R @@ -63,7 +63,6 @@ app_driver_tm_t_abnormality <- function() { } testthat::test_that("e2e - tm_t_abnormality: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() app_driver$expect_no_shiny_error() @@ -79,12 +78,11 @@ testthat::test_that( "e2e - tm_t_abnormality: Starts with specified label, arm_var, by_vars, add_total, exclude_base_abn, drop_arm_levels.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Abnormality Table" ) testthat::expect_equal( @@ -113,7 +111,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_abnormality: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -130,14 +127,13 @@ testthat::test_that( ) testthat::test_that("e2e - arm_var: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Please select a treatment variable." ) app_driver$stop() @@ -146,7 +142,6 @@ testthat::test_that("e2e - arm_var: Deselection of arm_var throws validation err testthat::test_that( "e2e - tm_t_abnormality: Selecting by_vars changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -163,14 +158,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_abnormality: Deselection of by_vars throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() app_driver$set_active_module_input("by_vars-dataset_ADLB_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("by_vars-dataset_ADLB_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("by_vars-dataset_ADLB_singleextract-select_input .shiny-validation-message")), "Please select a Row By Variable." ) app_driver$stop() @@ -179,7 +173,6 @@ testthat::test_that("e2e - tm_t_abnormality: Deselection of by_vars throws valid testthat::test_that( "e2e - tm_t_abnormality: Changing add_total changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -198,7 +191,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_abnormality: Changing exclude_base_abn changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -217,7 +209,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_abnormality: Changing drop_arm_levels does not change the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R b/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R index b5401fba8..5e32d05c9 100644 --- a/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R +++ b/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R @@ -58,7 +58,6 @@ app_driver_tm_t_abnormality_by_worst_grade <- function() { # nolint: object_leng testthat::test_that( "e2e - tm_t_abnormality_by_worst_grade: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() app_driver$expect_no_shiny_error() @@ -75,12 +74,11 @@ testthat::test_that( "e2e - tm_t_abnormality_by_worst_grade: Starts with specified label, arm_var, paramcd, id_var, atoxgr_var, worst_high_flag_var, worst_low_flag_var, worst_flag_indicator, add_total, drop_arm_levels.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Laboratory Test Results with Highest Grade Post-Baseline" ) testthat::expect_equal( @@ -120,7 +118,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_abnormality_by_worst_grade: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -139,7 +136,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_abnormality_by_worst_grade: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -156,30 +152,28 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_abnormality_by_worst_grade: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Please select a treatment variable." ) app_driver$stop() }) testthat::test_that("e2e - tm_t_abnormality_by_worst_grade: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() app_driver$set_active_module_input("paramcd-dataset_ADLB_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADLB_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "Please select at least one Laboratory parameter." ) app_driver$stop() @@ -188,7 +182,6 @@ testthat::test_that("e2e - tm_t_abnormality_by_worst_grade: Deselection of param testthat::test_that( "e2e - tm_t_abnormality_by_worst_grade: Changing add_total changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -208,7 +201,6 @@ testthat::test_that( "e2e - tm_t_abnormality_by_worst_grade: Changing drop_arm_levels does not change the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_t_ancova.R b/tests/testthat/test-shinytest2-tm_t_ancova.R index 4d80f8cfe..2092c238b 100644 --- a/tests/testthat/test-shinytest2-tm_t_ancova.R +++ b/tests/testthat/test-shinytest2-tm_t_ancova.R @@ -60,7 +60,6 @@ app_driver_tm_t_ancova <- function() { } testthat::test_that("e2e - tm_t_ancova: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() app_driver$expect_no_shiny_error() @@ -75,12 +74,11 @@ testthat::test_that( "e2e - tm_t_ancova: Starts with specified label, avisit, paramcd, aval_var, aval_var, arm_var, buckets, combine_comp_arms, interact_var, cov_var, conf_level, include_interact.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "ANCOVA Table" ) testthat::expect_equal( @@ -131,7 +129,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_ancova: Selecting avisit changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -151,16 +148,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_ancova: Deselection of avisit throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() app_driver$set_active_module_input("avisit-dataset_ADQS_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "avisit-dataset_ADQS_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "`Analysis Visit` field cannot be empty." ) app_driver$stop() @@ -169,7 +165,6 @@ testthat::test_that("e2e - tm_t_ancova: Deselection of avisit throws validation testthat::test_that( "e2e - tm_t_ancova: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -186,16 +181,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_ancova: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() app_driver$set_active_module_input("paramcd-dataset_ADQS_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADQS_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "`Select Endpoint` is not selected." ) app_driver$stop() @@ -204,7 +198,6 @@ testthat::test_that("e2e - tm_t_ancova: Deselection of paramcd throws validation testthat::test_that( "e2e - tm_t_ancova: Selecting aval_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -221,14 +214,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_ancova: Deselection of aval_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() app_driver$set_active_module_input("aval_var-dataset_ADQS_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("aval_var-dataset_ADQS_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aval_var-dataset_ADQS_singleextract-select_input .shiny-validation-message")), "Analysis variable cannot be empty." ) app_driver$stop() @@ -237,7 +229,6 @@ testthat::test_that("e2e - tm_t_ancova: Deselection of aval_var throws validatio testthat::test_that( "e2e - tm_t_ancova: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -254,14 +245,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_ancova: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Treatment variable must be selected" ) app_driver$stop() @@ -270,7 +260,6 @@ testthat::test_that("e2e - tm_t_ancova: Deselection of arm_var throws validation testthat::test_that( "e2e - tm_t_ancova: Selecting cov_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -289,7 +278,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_ancova: Deselection of cov_var changes table and doesn't throw validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R index f903ab367..0c5c4ad80 100644 --- a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R +++ b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R @@ -90,7 +90,6 @@ app_driver_tm_t_binary_outcome <- function() { } testthat::test_that("e2e - tm_t_binary_outcome: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() app_driver$expect_no_shiny_error() @@ -106,12 +105,11 @@ testthat::test_that( buckets, u_diff_ci, u_diff_test, strata_var, s_diff_ci, prop_ci_method, conf_level, aval_var, compare_arms, combine_comp_arms, u_odds_ratio, show_rsp_cat.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Responders" ) testthat::expect_equal( @@ -172,7 +170,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_binary_outcome: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -189,16 +186,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_binary_outcome: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() app_driver$set_active_module_input("paramcd-dataset_ADRS_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADRS_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "Please select a filter." ) app_driver$stop() @@ -207,7 +203,6 @@ testthat::test_that("e2e - tm_t_binary_outcome: Deselection of paramcd throws va testthat::test_that( "e2e - tm_t_binary_outcome: Selecting responders changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -224,14 +219,19 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_binary_outcome: Deselection of responders throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() + testthat::expect_false( + identical( + app_driver$get_text(".shiny-validation-message"), + "`Responders` field is empty" + ) + ) app_driver$set_active_module_input("responders", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-responders .shiny-validation-message"), + app_driver$get_text(".shiny-validation-message"), "`Responders` field is empty" ) app_driver$stop() @@ -240,7 +240,6 @@ testthat::test_that("e2e - tm_t_binary_outcome: Deselection of responders throws testthat::test_that( "e2e - tm_t_binary_outcome: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -257,14 +256,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_binary_outcome: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Treatment variable must be selected" ) app_driver$stop() @@ -273,7 +271,6 @@ testthat::test_that("e2e - tm_t_binary_outcome: Deselection of arm_var throws va testthat::test_that( "e2e - tm_t_binary_outcome: Selecting strata_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -293,7 +290,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_binary_outcome: Deselection of strata_var changes the table and does not throw validation errors.", # nolint line_length_linter { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_t_coxreg.R b/tests/testthat/test-shinytest2-tm_t_coxreg.R index 37713278e..78a5095ee 100644 --- a/tests/testthat/test-shinytest2-tm_t_coxreg.R +++ b/tests/testthat/test-shinytest2-tm_t_coxreg.R @@ -59,7 +59,6 @@ app_driver_tm_t_coxreg <- function() { } testthat::test_that("e2e - tm_t_coxreg: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() app_driver$expect_no_shiny_error() @@ -74,11 +73,10 @@ testthat::test_that( "e2e - tm_t_coxreg: Starts with specified label, type, paramcd, arm_var, buckets, cov_var, strata_var, pval_method, ties, conf_level, combine_comp_arms.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Cox Reg." ) testthat::expect_equal( @@ -128,7 +126,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_coxreg: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -145,16 +142,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_coxreg: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() app_driver$set_active_module_input("paramcd-dataset_ADTTE_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADTTE_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "An endpoint is required" ) app_driver$stop() @@ -163,7 +159,6 @@ testthat::test_that("e2e - tm_t_coxreg: Deselection of paramcd throws validation testthat::test_that( "e2e - tm_t_coxreg: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -180,14 +175,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_coxreg: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Treatment variable must be selected" ) app_driver$stop() @@ -196,7 +190,6 @@ testthat::test_that("e2e - tm_t_coxreg: Deselection of arm_var throws validation testthat::test_that( "e2e - tm_t_coxreg: Selecting cov_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -215,7 +208,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_coxreg: Deselection of cov_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -234,7 +226,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_coxreg: Selecting strata_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -253,7 +244,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_coxreg: Deselection of strata_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_coxreg() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_t_events.R b/tests/testthat/test-shinytest2-tm_t_events.R index e79edd2af..7a85fda3b 100644 --- a/tests/testthat/test-shinytest2-tm_t_events.R +++ b/tests/testthat/test-shinytest2-tm_t_events.R @@ -41,7 +41,6 @@ app_driver_tm_t_events <- function() { } testthat::test_that("e2e - tm_t_events: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() app_driver$expect_no_shiny_error() @@ -56,12 +55,11 @@ testthat::test_that( "e2e - tm_t_events: Starts with specified label, arm_var, hlt, llt, sort_criteria, prune_freq, prune_diff, add_total, drop_arm_levels.", { - testthat::skip("chromium") skip_if_too_deep(5) 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( @@ -97,7 +95,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -114,14 +111,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_events: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() 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$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() @@ -130,7 +127,6 @@ testthat::test_that("e2e - tm_t_events: Deselection of arm_var throws validation testthat::test_that( "e2e - tm_t_events: Selecting hlt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -149,7 +145,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events: Deselection of hlt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -168,7 +163,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events: Selecting llt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -187,7 +181,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events: Deselection of llt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") 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 85ab617e3..bdfdbffcb 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_by_grade.R +++ b/tests/testthat/test-shinytest2-tm_t_events_by_grade.R @@ -53,7 +53,6 @@ app_driver_tm_t_events_by_grade <- function() { # nolint: object_length. testthat::test_that( "e2e - tm_t_events_by_grade: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() app_driver$expect_no_shiny_error() @@ -69,11 +68,10 @@ testthat::test_that( "e2e - tm_t_events_by_grade: Starts with specified label, arm_var, hlt, llt, grade, prune_freq, prune_diff, add_total, col_by_grade, drop_arm_levels.", { - testthat::skip("chromium") 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( @@ -110,7 +108,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_by_grade: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -127,14 +124,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_events_by_grade: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() 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$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() @@ -143,7 +140,6 @@ testthat::test_that("e2e - tm_t_events_by_grade: Deselection of arm_var throws v testthat::test_that( "e2e - tm_t_events_by_grade: Selecting hlt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -162,7 +158,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_by_grade: Deselection of hlt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -181,7 +176,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_by_grade: Selecting llt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -200,7 +194,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_by_grade: Deselection of llt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -219,7 +212,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_by_grade: Selecting grade changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -236,14 +228,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_events_by_grade: Deselection of grade throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() 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 <- "grade-dataset_ADAE_singleextract-select_input .shiny-validation-message" testthat::expect_equal( - 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 aed20ea48..33c37f95e 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_patyear.R +++ b/tests/testthat/test-shinytest2-tm_t_events_patyear.R @@ -55,7 +55,6 @@ app_driver_tm_t_events_patyear <- function() { } testthat::test_that("e2e - tm_t_events_patyear: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() app_driver$expect_no_shiny_error() @@ -70,11 +69,10 @@ testthat::test_that( "e2e - tm_t_events_patyear: Starts with specified label, arm_var, paramcd, conf_level, conf_method, num_pt_year, input_time_unit, add_total, drop_arm_levels.", { - testthat::skip("chromium") 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( @@ -110,7 +108,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_patyear: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() table_before <- app_driver$get_active_module_table_output("patyear_table-table-with-settings") @@ -127,7 +124,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_events_patyear: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() app_driver$set_active_module_input("paramcd-dataset_ADAETTE_singleextract-filter1-vals", NULL) @@ -137,9 +133,9 @@ testthat::test_that("e2e - tm_t_events_patyear: Deselection of paramcd throws va ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADAETTE_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "A Event Type Parameter is required" ) app_driver$stop() @@ -148,7 +144,6 @@ testthat::test_that("e2e - tm_t_events_patyear: Deselection of paramcd throws va testthat::test_that( "e2e - tm_t_events_patyear: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() table_before <- app_driver$get_active_module_table_output("patyear_table-table-with-settings") @@ -165,7 +160,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_events_patyear: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL) @@ -174,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$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() @@ -184,7 +179,6 @@ testthat::test_that("e2e - tm_t_events_patyear: Deselection of arm_var throws va testthat::test_that( "e2e - tm_t_events_patyear: Selecting 2 variables as arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() table_before <- app_driver$get_active_module_table_output("patyear_table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_t_events_summary.R b/tests/testthat/test-shinytest2-tm_t_events_summary.R index a3a08f3f7..57df6737f 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_summary.R +++ b/tests/testthat/test-shinytest2-tm_t_events_summary.R @@ -94,7 +94,6 @@ app_driver_tm_t_events_summary <- function() { } testthat::test_that("e2e - tm_t_events_summary: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() app_driver$expect_no_shiny_error() @@ -109,11 +108,10 @@ testthat::test_that( "e2e - tm_t_events_summary: Starts with specified label, arm_var, flag_var_anl, flag_var_aesi, add_total, count_subj, count_pt, count_events.", { - testthat::skip("chromium") 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( @@ -139,7 +137,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_summary: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -156,14 +153,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_events_summary: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() 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$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() @@ -172,7 +169,6 @@ testthat::test_that("e2e - tm_t_events_summary: Deselection of arm_var throws va testthat::test_that( "e2e - tm_t_events_summary: Selecting flag_var_anl changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -192,7 +188,6 @@ testthat::test_that( "e2e - tm_t_events_summary: Deselection of flag_var_anl changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -212,7 +207,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_events_summary: Selecting flag_var_aesi changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -232,7 +226,6 @@ testthat::test_that( "e2e - tm_t_events_summary: Deselection of flag_var_aesi changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") diff --git a/tests/testthat/test-shinytest2-tm_t_exposure.R b/tests/testthat/test-shinytest2-tm_t_exposure.R index c6a82894d..14a1b1bbe 100644 --- a/tests/testthat/test-shinytest2-tm_t_exposure.R +++ b/tests/testthat/test-shinytest2-tm_t_exposure.R @@ -71,7 +71,6 @@ app_driver_tm_t_exposure <- function() { } testthat::test_that("e2e - tm_t_exposure: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() app_driver$expect_no_shiny_error() @@ -86,11 +85,10 @@ testthat::test_that( "e2e - tm_t_exposure: Starts with specified label, paramcd, parcat, col_by_var, row_by_var, add_total_row, add_total", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Duration of Exposure Table" ) testthat::expect_equal( @@ -118,7 +116,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_exposure: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -135,16 +132,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_exposure: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() app_driver$set_active_module_input("paramcd-dataset_ADEX_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADEX_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "Please select a parameter value." ) app_driver$stop() @@ -153,7 +149,6 @@ testthat::test_that("e2e - tm_t_exposure: Deselection of paramcd throws validati testthat::test_that( "e2e - tm_t_exposure: Selecting parcat changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -170,16 +165,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_exposure: Deselection of parcat throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() app_driver$set_active_module_input("parcat-dataset_ADEX_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "parcat-dataset_ADEX_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "Please select a parameter category value." ) app_driver$stop() @@ -188,7 +182,6 @@ testthat::test_that("e2e - tm_t_exposure: Deselection of parcat throws validatio testthat::test_that( "e2e - tm_t_exposure: Selecting col_by_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -207,7 +200,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_exposure: Deselection of col_by_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -226,7 +218,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_exposure: Selecting row_by_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -243,16 +234,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_exposure: Deselection of row_by_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() app_driver$set_active_module_input("row_by_var-dataset_ADEX_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "row_by_var-dataset_ADEX_singleextract-select_input .shiny-validation-message" - ), + )), "Please select a row by variable." ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_logistic.R b/tests/testthat/test-shinytest2-tm_t_logistic.R index 89da853d5..3ce109f6e 100644 --- a/tests/testthat/test-shinytest2-tm_t_logistic.R +++ b/tests/testthat/test-shinytest2-tm_t_logistic.R @@ -53,7 +53,6 @@ app_driver_tm_t_logistic <- function() { } testthat::test_that("e2e - tm_t_logistic: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() app_driver$expect_no_shiny_error() @@ -68,11 +67,10 @@ testthat::test_that( "e2e - tm_t_logistic: Starts with specified label, paramcd, responders, arm_var, buckets, cov_var, interaction_var, conf_level, combine_comp_arms.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Logistic Regression" ) testthat::expect_equal( @@ -111,7 +109,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_logistic: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -128,16 +125,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_logistic: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() app_driver$set_active_module_input("paramcd-dataset_ADRS_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADRS_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "`Select Endpoint` field is empty" ) app_driver$stop() @@ -146,7 +142,6 @@ testthat::test_that("e2e - tm_t_logistic: Deselection of paramcd throws validati testthat::test_that( "e2e - tm_t_logistic: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -163,14 +158,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_logistic: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Treatment variable must be selected" ) app_driver$stop() @@ -179,7 +173,6 @@ testthat::test_that("e2e - tm_t_logistic: Deselection of arm_var throws validati testthat::test_that( "e2e - tm_t_logistic: Selecting cov_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -196,14 +189,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_logistic: Deselection of cov_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() app_driver$set_active_module_input("cov_var-dataset_ADRS_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("cov_var-dataset_ADRS_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("cov_var-dataset_ADRS_singleextract-select_input .shiny-validation-message")), "`Covariates` field is empty" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_mult_events.R b/tests/testthat/test-shinytest2-tm_t_mult_events.R index 8a06f2dc2..8479ef8bc 100644 --- a/tests/testthat/test-shinytest2-tm_t_mult_events.R +++ b/tests/testthat/test-shinytest2-tm_t_mult_events.R @@ -40,7 +40,6 @@ app_driver_tm_t_mult_events <- function() { } testthat::test_that("e2e - tm_t_mult_events: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() app_driver$expect_no_shiny_error() @@ -54,11 +53,10 @@ testthat::test_that("e2e - tm_t_mult_events: Module initializes in teal without testthat::test_that( "e2e - tm_t_mult_events: Starts with specified label, arm_var, hlt, llt, add_total, drop_arm_levels.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Concomitant Medications by Medication Class and Preferred Name" ) testthat::expect_equal( @@ -82,7 +80,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_mult_events: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -99,14 +96,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_mult_events: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Please select a treatment variable" ) app_driver$stop() @@ -115,7 +111,6 @@ testthat::test_that("e2e - tm_t_mult_events: Deselection of arm_var throws valid testthat::test_that( "e2e - tm_t_mult_events: Selecting hlt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -134,7 +129,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_mult_events: Deselection of hlt changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -151,13 +145,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_mult_events: Deselection of llt throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() app_driver$set_active_module_input("llt-dataset_ADCM_singleextract-select", NULL) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("llt-dataset_ADCM_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("llt-dataset_ADCM_singleextract-select_input .shiny-validation-message")), "Please select a \"LOW LEVEL TERM\" variable" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R b/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R index 2b4608512..ce39b3d80 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R @@ -24,7 +24,6 @@ app_driver_tm_t_pp_basic_info <- function() { } testthat::test_that("e2e - tm_t_pp_basic_info: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_basic_info() app_driver$expect_no_shiny_error() @@ -36,11 +35,10 @@ testthat::test_that("e2e - tm_t_pp_basic_info: Module initializes in teal withou }) testthat::test_that("e2e - tm_t_pp_basic_info: Starts with specified label, patient_id, vars.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_basic_info() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Basic Info" ) testthat::expect_equal( @@ -57,7 +55,6 @@ testthat::test_that("e2e - tm_t_pp_basic_info: Starts with specified label, pati testthat::test_that( "e2e - tm_t_pp_basic_info: Selecting patient_id changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_basic_info() table_before <- app_driver$get_active_module_table_output("basic_info_table") @@ -76,7 +73,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_basic_info: Deselection of patient_id throws validation error and table is not visible.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_basic_info() app_driver$set_active_module_input("patient_id", NULL) @@ -88,7 +84,7 @@ testthat::test_that( ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message")), "Please select a patient" ) app_driver$stop() @@ -98,7 +94,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_basic_info: Selecting cov_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_basic_info() table_before <- app_driver$get_active_module_table_output("basic_info_table") @@ -118,7 +113,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_basic_info: Deselection of cov_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_basic_info() app_driver$set_active_module_input("vars-dataset_ADSL_singleextract-select", NULL) @@ -130,7 +124,7 @@ testthat::test_that("e2e - tm_t_pp_basic_info: Deselection of cov_var throws val ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("vars-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("vars-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "Please select basic info variables" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R b/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R index 46a2b0140..6d971ab9f 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R @@ -46,9 +46,9 @@ app_driver_tm_t_pp_laboratory <- function() { } testthat::test_that("e2e - tm_t_pp_laboratory: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() app_driver$expect_no_shiny_error() app_driver$expect_no_validation_error() testthat::expect_true( @@ -61,12 +61,11 @@ testthat::test_that( "e2e - tm_t_pp_laboratory: Starts with specified label, patient_id, paramcd, param, timepoints, aval_var, avalu_var, anrind, round_value.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Vitals" ) testthat::expect_equal( @@ -108,11 +107,12 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_laboratory: Selecting patient_id changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() table_before <- app_driver$get_active_module_table_output("lab_values_table", which = 2) app_driver$set_active_module_input("patient_id", "AB12345-USA-1-id-261") + app_driver$wait_for_idle() testthat::expect_false( identical( table_before, @@ -125,7 +125,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of patient_id throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$set_active_module_input("patient_id", NULL) @@ -137,7 +136,7 @@ testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of patient_id throws ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message")), "Please select a patient" ) app_driver$stop() @@ -147,11 +146,12 @@ testthat::test_that( "e2e - tm_t_pp_laboratory: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() table_before <- app_driver$get_active_module_table_output("lab_values_table", which = 2) app_driver$set_active_module_input("paramcd-dataset_ADLB_singleextract-select", "STUDYID") + app_driver$wait_for_idle() testthat::expect_false( identical( table_before, @@ -164,7 +164,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$set_active_module_input("paramcd-dataset_ADLB_singleextract-select", NULL) @@ -176,7 +175,7 @@ testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of paramcd throws val ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("paramcd-dataset_ADLB_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("paramcd-dataset_ADLB_singleextract-select_input .shiny-validation-message")), "Please select PARAMCD variable." ) app_driver$stop() @@ -186,11 +185,12 @@ testthat::test_that( "e2e - tm_t_pp_laboratory: Selecting param changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() table_before <- app_driver$get_active_module_table_output("lab_values_table", which = 2) app_driver$set_active_module_input("param-dataset_ADLB_singleextract-select", "SEX") + app_driver$wait_for_idle() testthat::expect_false( identical( table_before, @@ -205,7 +205,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_laboratory: Deselection of param throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$set_active_module_input("param-dataset_ADLB_singleextract-select", NULL) @@ -217,7 +216,7 @@ testthat::test_that( ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("param-dataset_ADLB_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("param-dataset_ADLB_singleextract-select_input .shiny-validation-message")), "Please select PARAM variable." ) app_driver$stop() @@ -228,11 +227,12 @@ testthat::test_that( "e2e - tm_t_pp_laboratory: Selecting timepoints changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() table_before <- app_driver$get_active_module_table_output("lab_values_table", which = 2) app_driver$set_active_module_input("timepoints-dataset_ADLB_singleextract-select", "AGE") + app_driver$wait_for_idle() testthat::expect_false( identical( table_before, @@ -245,7 +245,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of timepoints throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$set_active_module_input("timepoints-dataset_ADLB_singleextract-select", NULL) @@ -257,9 +256,9 @@ testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of timepoints throws ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "timepoints-dataset_ADLB_singleextract-select_input .shiny-validation-message" - ), + )), "Please select timepoints variable." ) app_driver$stop() @@ -269,11 +268,12 @@ testthat::test_that( "e2e - tm_t_pp_laboratory: Selecting avalu changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() table_before <- app_driver$get_active_module_table_output("lab_values_table", which = 2) app_driver$set_active_module_input("avalu_var-dataset_ADLB_singleextract-select", "SEX") + app_driver$wait_for_idle() testthat::expect_false( identical( table_before, @@ -286,7 +286,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of avalu throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$set_active_module_input("avalu_var-dataset_ADLB_singleextract-select", NULL) @@ -298,9 +297,9 @@ testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of avalu throws valid ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "avalu_var-dataset_ADLB_singleextract-select_input .shiny-validation-message" - ), + )), "Please select AVALU variable." ) app_driver$stop() @@ -310,11 +309,12 @@ testthat::test_that( "e2e - tm_t_pp_laboratory: Selecting aval_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() table_before <- app_driver$get_active_module_table_output("lab_values_table", which = 2) app_driver$set_active_module_input("aval_var-dataset_ADLB_singleextract-select", "AGE") + app_driver$wait_for_idle() testthat::expect_false( identical( table_before, @@ -327,7 +327,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of aval_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$set_active_module_input("aval_var-dataset_ADLB_singleextract-select", NULL) @@ -339,7 +338,7 @@ testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of aval_var throws va ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("aval_var-dataset_ADLB_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("aval_var-dataset_ADLB_singleextract-select_input .shiny-validation-message")), "Please select AVAL variable." ) app_driver$stop() @@ -349,11 +348,12 @@ testthat::test_that( "e2e - tm_t_pp_laboratory: Selecting arind changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$wait_for_idle() table_before <- app_driver$get_active_module_table_output("lab_values_table", which = 2) app_driver$set_active_module_input("anrind-dataset_ADLB_singleextract-select", "AGEU") + app_driver$wait_for_idle() testthat::expect_false( identical( table_before, @@ -366,7 +366,6 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of arind throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$set_active_module_input("anrind-dataset_ADLB_singleextract-select", NULL) @@ -378,7 +377,7 @@ testthat::test_that("e2e - tm_t_pp_laboratory: Deselection of arind throws valid ) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("anrind-dataset_ADLB_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("anrind-dataset_ADLB_singleextract-select_input .shiny-validation-message")), "Please select ANRIND variable." ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R b/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R index fc06bffbd..a753ac8c8 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R @@ -36,7 +36,6 @@ app_driver_tm_t_pp_medical_history <- function() { # nolint: object_length. testthat::test_that( "e2e - tm_t_pp_medical_history: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() app_driver$expect_no_shiny_error() @@ -51,12 +50,11 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_medical_history: Starts with specified label, patient_id, mhterm, mhbodsys, mhdistat.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Medical History" ) testthat::expect_equal( @@ -82,7 +80,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_medical_history: Selecting patient_id changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -99,14 +96,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_medical_history: Deselection of patient_id throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() app_driver$set_active_module_input("patient_id", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message")), "Please select a patient" ) app_driver$stop() @@ -115,7 +111,6 @@ testthat::test_that("e2e - tm_t_pp_medical_history: Deselection of patient_id th testthat::test_that( "e2e - tm_t_pp_medical_history: Selecting mhterm changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -132,14 +127,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_medical_history: Deselection of mhterm throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() app_driver$set_active_module_input("mhterm-dataset_ADMH_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("mhterm-dataset_ADMH_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("mhterm-dataset_ADMH_singleextract-select_input .shiny-validation-message")), "Please select MHTERM variable." ) app_driver$stop() @@ -148,7 +142,6 @@ testthat::test_that("e2e - tm_t_pp_medical_history: Deselection of mhterm throws testthat::test_that( "e2e - tm_t_pp_medical_history: Selecting mhbodsys changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -165,14 +158,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_medical_history: Deselection of mhbodsys throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() app_driver$set_active_module_input("mhbodsys-dataset_ADMH_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("mhbodsys-dataset_ADMH_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("mhbodsys-dataset_ADMH_singleextract-select_input .shiny-validation-message")), "Please select MHBODSYS variable." ) app_driver$stop() @@ -181,7 +173,6 @@ testthat::test_that("e2e - tm_t_pp_medical_history: Deselection of mhbodsys thro testthat::test_that( "e2e - tm_t_pp_medical_history: Selecting mhbodsys changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -198,14 +189,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_medical_history: Deselection of mhdistat throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() app_driver$set_active_module_input("mhdistat-dataset_ADMH_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("mhdistat-dataset_ADMH_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("mhdistat-dataset_ADMH_singleextract-select_input .shiny-validation-message")), "Please select MHDISTAT variable." ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R b/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R index f36f4a651..67483a9b6 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R @@ -46,7 +46,6 @@ app_driver_tm_t_pp_prior_medication <- function() { # nolint: object_length. testthat::test_that( "e2e - tm_t_pp_prior_medication: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() app_driver$expect_no_shiny_error() @@ -61,11 +60,10 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_prior_medication: Starts with specified label, patient_id, cmdecod, atirel, cmindc, cmstdy.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Prior Medication" ) testthat::expect_equal( @@ -95,7 +93,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_pp_prior_medication: Selecting patient_id changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() table_before <- app_driver$get_active_module_table_output("prior_medication_table") @@ -112,13 +109,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of patient_id throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() app_driver$set_active_module_input("patient_id", NULL) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("patient_id_input .shiny-validation-message")), "Please select patient id" ) app_driver$stop() @@ -127,7 +123,6 @@ testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of patient_id t testthat::test_that( "e2e - tm_t_pp_prior_medication: Selecting cmdecod changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() table_before <- app_driver$get_active_module_table_output("prior_medication_table") @@ -144,13 +139,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of cmdecod throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() app_driver$set_active_module_input("cmdecod-dataset_ADCM_singleextract-select", NULL) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("cmdecod-dataset_ADCM_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("cmdecod-dataset_ADCM_singleextract-select_input .shiny-validation-message")), "A medication decoding variable is required" ) app_driver$stop() @@ -159,7 +153,6 @@ testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of cmdecod thro testthat::test_that( "e2e - tm_t_pp_prior_medication: Selecting atirel changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() table_before <- app_driver$get_active_module_table_output("prior_medication_table") @@ -176,13 +169,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of atirel throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() app_driver$set_active_module_input("atirel-dataset_ADCM_singleextract-select", NULL) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("atirel-dataset_ADCM_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("atirel-dataset_ADCM_singleextract-select_input .shiny-validation-message")), "An ATIREL variable is required" ) app_driver$stop() @@ -191,7 +183,6 @@ testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of atirel throw testthat::test_that( "e2e - tm_t_pp_prior_medication: Selecting cmindc changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() table_before <- app_driver$get_active_module_table_output("prior_medication_table") @@ -208,13 +199,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of cmindc throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() app_driver$set_active_module_input("cmindc-dataset_ADCM_singleextract-select", NULL) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("cmindc-dataset_ADCM_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("cmindc-dataset_ADCM_singleextract-select_input .shiny-validation-message")), "A CMINDC variable is required" ) app_driver$stop() @@ -223,7 +213,6 @@ testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of cmindc throw testthat::test_that( "e2e - tm_t_pp_prior_medication: Selecting cmstdy changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() table_before <- app_driver$get_active_module_table_output("prior_medication_table") @@ -240,13 +229,12 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_pp_prior_medication: Deselection of cmstdy throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() app_driver$set_active_module_input("cmstdy-dataset_ADCM_singleextract-select", NULL) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("cmstdy-dataset_ADCM_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("cmstdy-dataset_ADCM_singleextract-select_input .shiny-validation-message")), "A CMSTDY variable is required" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R b/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R index 209533c12..de6aea52b 100644 --- a/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R @@ -51,7 +51,6 @@ app_driver_tm_t_shift_by_arm <- function() { } testthat::test_that("e2e - tm_t_shift_by_arm: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() app_driver$expect_no_shiny_error() @@ -66,11 +65,10 @@ testthat::test_that( "e2e - tm_t_shift_by_arm: Starts with specified label, arm_varparamcd, visit_var, useNA, treatment_flag_var, add_total.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Shift by Arm Table" ) testthat::expect_equal( @@ -101,7 +99,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_shift_by_arm: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -118,14 +115,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() 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$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() @@ -134,7 +131,6 @@ testthat::test_that("e2e - tm_t_shift_by_arm: Deselection of arm_var throws vali testthat::test_that( "e2e - tm_t_shift_by_arm: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -151,16 +147,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() app_driver$set_active_module_input("paramcd-dataset_ADEG_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADEG_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "An endpoint is required" ) app_driver$stop() @@ -169,7 +164,6 @@ testthat::test_that("e2e - tm_t_shift_by_arm: Deselection of paramcd throws vali testthat::test_that( "e2e - tm_t_shift_by_arm: Selecting visit_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -186,16 +180,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm: Deselection of visit_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() app_driver$set_active_module_input("visit_var-dataset_ADEG_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "visit_var-dataset_ADEG_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "A visit is required" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R b/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R index 2744d965f..027c165cc 100644 --- a/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R @@ -53,7 +53,6 @@ app_driver_tm_t_shift_by_arm_by_worst <- function() { # nolint: object_length. testthat::test_that( "e2e - tm_t_shift_by_arm_by_worst: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() app_driver$expect_no_shiny_error() @@ -69,12 +68,11 @@ testthat::test_that( "e2e - tm_t_shift_by_arm_by_worst: Starts with specified label, arm_var, paramcd, worst_flag_var, aval_var, baseline_var, useNA, treatment_flag_var, add_total.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Shift by Arm Table" ) testthat::expect_equal( @@ -114,7 +112,6 @@ testthat::test_that( "e2e - tm_t_shift_by_arm_by_worst: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -131,14 +128,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm_by_worst: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() 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$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() @@ -147,7 +144,6 @@ testthat::test_that("e2e - tm_t_shift_by_arm_by_worst: Deselection of arm_var th testthat::test_that( "e2e - tm_t_shift_by_arm_by_worst: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -164,16 +160,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm_by_worst: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() app_driver$set_active_module_input("paramcd-dataset_ADEG_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADEG_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "An endpoint is required" ) app_driver$stop() @@ -183,7 +178,6 @@ testthat::test_that( "e2e - tm_t_shift_by_arm_by_worst: Selecting worst_flag changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -200,16 +194,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm_by_worst: Deselection of worst_flag throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() app_driver$set_active_module_input("worst_flag_var-dataset_ADEG_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "worst_flag_var-dataset_ADEG_singleextract-select_input .shiny-validation-message" - ), + )), "A worst flag variable is required" ) app_driver$stop() @@ -219,7 +212,6 @@ testthat::test_that( "e2e - tm_t_shift_by_arm_by_worst: Selecting aval_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -236,14 +228,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm_by_worst: Deselection of aval_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() app_driver$set_active_module_input("aval_var-dataset_ADEG_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 <- "aval_var-dataset_ADEG_singleextract-select_input .shiny-validation-message" testthat::expect_equal( - app_driver$namespaces(TRUE)$module("aval_var-dataset_ADEG_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)), "An analysis range indicator required" ) app_driver$stop() @@ -253,7 +245,6 @@ testthat::test_that( "e2e - tm_t_shift_by_arm_by_worst: Selecting baseline_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -270,16 +261,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_arm_by_worst: Deselection of baseline_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() app_driver$set_active_module_input("baseline_var-dataset_ADEG_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "baseline_var-dataset_ADEG_singleextract-select_input .shiny-validation-message" - ), + )), "A baseline reference range indicator is required" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R b/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R index 2aeff80a7..ab8c99b54 100644 --- a/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R @@ -67,7 +67,6 @@ app_driver_tm_t_shift_by_grade <- function() { testthat::test_that( "e2e - tm_t_shift_by_grade: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() app_driver$expect_no_shiny_error() @@ -83,11 +82,10 @@ testthat::test_that( "e2e - tm_t_shift_by_grade: Starts with specified label, arm_var, paramcd, worst_flag_var, anl_toxgrade_var, base_toxgrade_var, worst_flag_indicator, add_total, drop_arm_levels, code_missing_baseline.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Grade Laboratory Abnormality Table" ) testthat::expect_equal( @@ -124,7 +122,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_shift_by_grade: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -141,14 +138,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_grade: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() 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$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() @@ -157,7 +154,6 @@ testthat::test_that("e2e - tm_t_shift_by_grade: Deselection of arm_var throws va testthat::test_that( "e2e - tm_t_shift_by_grade: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -174,16 +170,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_grade: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() app_driver$set_active_module_input("paramcd-dataset_ADLB_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADLB_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "A laboratory parameter is required" ) app_driver$stop() @@ -192,7 +187,6 @@ testthat::test_that("e2e - tm_t_shift_by_grade: Deselection of paramcd throws va testthat::test_that( "e2e - tm_t_shift_by_grade: Selecting worst_flag changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -209,16 +203,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_shift_by_grade: Deselection of worst_flag throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() app_driver$set_active_module_input("worst_flag_var-dataset_ADLB_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "worst_flag_var-dataset_ADLB_singleextract-select_input .shiny-validation-message" - ), + )), "A worst treatment flag is required" ) app_driver$stop() @@ -280,7 +273,6 @@ app_driver_tm_t_shift_by_grade_invalid_data <- function() { # nolint: object_len testthat::test_that( "e2e - tm_t_shift_by_grade: Invalid worst flag indicator shows validation error instead of hanging", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade_invalid_data() app_driver$expect_validation_error() diff --git a/tests/testthat/test-shinytest2-tm_t_smq.R b/tests/testthat/test-shinytest2-tm_t_smq.R index 526d4193f..aa26f260c 100644 --- a/tests/testthat/test-shinytest2-tm_t_smq.R +++ b/tests/testthat/test-shinytest2-tm_t_smq.R @@ -56,7 +56,6 @@ app_driver_tm_t_smq <- function() { } testthat::test_that("e2e - tm_t_smq: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() app_driver$expect_no_shiny_error() @@ -70,11 +69,10 @@ testthat::test_that("e2e - tm_t_smq: Module initializes in teal without errors a testthat::test_that( "e2e - tm_t_smq: Starts with specified label, arm_var, llt, baskets, sort_criteria, add_total, drop_arm_levels.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() 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 SMQ Table" ) testthat::expect_equal( @@ -102,7 +100,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_smq: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -119,21 +116,19 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_smq: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")), "At least one treatment variable is required" ) app_driver$stop() }) testthat::test_that("e2e - tm_t_smq: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -149,14 +144,13 @@ testthat::test_that("e2e - tm_t_smq: Selecting paramcd changes the table and doe }) testthat::test_that("e2e - tm_t_smq: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() app_driver$set_active_module_input("llt-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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("llt-dataset_ADAE_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("llt-dataset_ADAE_singleextract-select_input .shiny-validation-message")), "A low level term variable is required" ) app_driver$stop() @@ -165,7 +159,6 @@ testthat::test_that("e2e - tm_t_smq: Deselection of paramcd throws validation er testthat::test_that( "e2e - tm_t_smq: Selecting worst_flag changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -182,14 +175,13 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_smq: Deselection of worst_flag throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() app_driver$set_active_module_input("baskets-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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module("baskets-dataset_ADAE_singleextract-select_input .shiny-validation-message"), + app_driver$get_text(app_driver$namespaces(TRUE)$module("baskets-dataset_ADAE_singleextract-select_input .shiny-validation-message")), "At least one basket is required" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_summary.R b/tests/testthat/test-shinytest2-tm_t_summary.R index e61afae38..665493996 100644 --- a/tests/testthat/test-shinytest2-tm_t_summary.R +++ b/tests/testthat/test-shinytest2-tm_t_summary.R @@ -36,7 +36,6 @@ app_driver_tm_t_summary <- function() { } testthat::test_that("e2e - tm_t_summary: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary() app_driver$expect_no_shiny_error() @@ -48,11 +47,10 @@ testthat::test_that("e2e - tm_t_summary: Module initializes in teal without erro }) testthat::test_that("e2e - tm_t_summary: Starts with specified label, arm_var, summarize_vars, useNA, denominator.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Demographic Table" ) testthat::expect_equal( @@ -77,7 +75,6 @@ testthat::test_that("e2e - tm_t_summary: Starts with specified label, arm_var, s testthat::test_that( "e2e - tm_t_summary: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -94,14 +91,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_summary: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary() 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$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 column variables" ) app_driver$stop() @@ -110,7 +107,6 @@ testthat::test_that("e2e - tm_t_summary: Deselection of arm_var throws validatio testthat::test_that( "e2e - tm_t_summary: Selecting summarize_vars changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -127,16 +123,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_summary: Deselection of summarize_vars throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary() app_driver$set_active_module_input("summarize_vars-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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "summarize_vars-dataset_ADSL_singleextract-select_input .shiny-validation-message" - ), + )), "Please select a summarize variable" ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_summary_by.R b/tests/testthat/test-shinytest2-tm_t_summary_by.R index baac22536..4c886de58 100644 --- a/tests/testthat/test-shinytest2-tm_t_summary_by.R +++ b/tests/testthat/test-shinytest2-tm_t_summary_by.R @@ -54,7 +54,6 @@ app_driver_tm_t_summary_by <- function() { } testthat::test_that("e2e - tm_t_summary_by: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() app_driver$expect_no_shiny_error() @@ -69,11 +68,10 @@ testthat::test_that( "e2e - tm_t_summary_by: Starts with specified label, arm_var, paramcd, by_vars, summarize_vars, useNA, numeric_stats, add_total, parallel_vars, row_groups, drop_zero_levels.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Summary by Row Groups Table" ) testthat::expect_equal( @@ -111,7 +109,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_summary_by: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -128,14 +125,14 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_summary_by: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() 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$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 column variables" ) app_driver$stop() @@ -144,7 +141,6 @@ testthat::test_that("e2e - tm_t_summary_by: Deselection of arm_var throws valida testthat::test_that( "e2e - tm_t_summary_by: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -161,16 +157,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_summary_by: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() app_driver$set_active_module_input("paramcd-dataset_ADLB_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADLB_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "Please select a filter." ) app_driver$stop() @@ -179,7 +174,6 @@ testthat::test_that("e2e - tm_t_summary_by: Deselection of arm_var throws valida testthat::test_that( "e2e - tm_t_summary_by: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -198,7 +192,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_summary_by: Deselection of arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -217,7 +210,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_summary_by: Selecting summarize_vars changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -234,16 +226,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_summary_by: Deselection of summarize_vars throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() app_driver$set_active_module_input("summarize_vars-dataset_ADLB_singleextract-select", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "summarize_vars-dataset_ADLB_singleextract-select_input .shiny-validation-message" - ), + )), "Please select a summarize variable." ) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_t_tte.R b/tests/testthat/test-shinytest2-tm_t_tte.R index dcacb2f8b..866e5ec8e 100644 --- a/tests/testthat/test-shinytest2-tm_t_tte.R +++ b/tests/testthat/test-shinytest2-tm_t_tte.R @@ -75,7 +75,6 @@ app_driver_tm_t_tte <- function() { } testthat::test_that("e2e - tm_t_tte: Module initializes in teal without errors and produces table output.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() app_driver$expect_no_shiny_error() @@ -91,11 +90,10 @@ testthat::test_that( strata_var, time_points, pval_method_coxph, ties_coxph, conf_level_coxph, conf_level_survfit, conf_type_survfit, probs_survfit, compare_arms, combine_comp_arms.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() testthat::expect_equal( - app_driver$get_text("#teal-teal_modules-active_tab .active > a"), + app_driver$get_text("a.nav-link.active"), "Time To Event Table" ) testthat::expect_equal( @@ -158,7 +156,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_tte: Selecting paramcd changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -175,16 +172,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_tte: Deselection of paramcd throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() app_driver$set_active_module_input("paramcd-dataset_ADTTE_singleextract-filter1-vals", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "paramcd-dataset_ADTTE_singleextract-filter1-vals_input .shiny-validation-message" - ), + )), "An endpoint is required" ) app_driver$stop() @@ -193,7 +189,6 @@ testthat::test_that("e2e - tm_t_tte: Deselection of paramcd throws validation er testthat::test_that( "e2e - tm_t_tte: Selecting arm_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -210,16 +205,15 @@ testthat::test_that( ) testthat::test_that("e2e - tm_t_tte: Deselection of arm_var throws validation error.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() 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() testthat::expect_equal( - app_driver$namespaces(TRUE)$module( + app_driver$get_text(app_driver$namespaces(TRUE)$module( "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message" - ), + )), "Treatment variable must be selected" ) app_driver$stop() @@ -228,7 +222,6 @@ testthat::test_that("e2e - tm_t_tte: Deselection of arm_var throws validation er testthat::test_that( "e2e - tm_t_tte: Selecting strata_var changes the table and does not throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() table_before <- app_driver$get_active_module_table_output("table-table-with-settings") @@ -247,7 +240,6 @@ testthat::test_that( testthat::test_that( "e2e - tm_t_tte: Deselection of strata_var changes the table and throw validation errors.", { - testthat::skip("chromium") skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() table_before <- app_driver$get_active_module_table_output("table-table-with-settings")