@@ -14,44 +14,51 @@ app_driver_tm_missing_data <- function() {
1414 })
1515
1616 init_teal_app_driver(
17- teal :: init(
18- data = data ,
19- modules = tm_missing_data(
20- label = " Missing data" ,
21- plot_height = c(600 , 400 , 5000 ),
22- plot_width = NULL ,
23- datanames = " all" ,
24- ggtheme = " gray" ,
25- ggplot2_args = list (
26- " Combinations Hist" = teal.widgets :: ggplot2_args(
27- labs = list (subtitle = " Plot produced by Missing Data Module" , caption = NULL )
28- ),
29- " Combinations Main" = teal.widgets :: ggplot2_args(labs = list (title = NULL ))
17+ data = data ,
18+ modules = tm_missing_data(
19+ label = " Missing data" ,
20+ plot_height = c(600 , 400 , 5000 ),
21+ plot_width = NULL ,
22+ datanames = " all" ,
23+ ggtheme = " gray" ,
24+ ggplot2_args = list (
25+ " Combinations Hist" = teal.widgets :: ggplot2_args(
26+ labs = list (subtitle = " Plot produced by Missing Data Module" , caption = NULL )
3027 ),
31- pre_output = NULL ,
32- post_output = NULL
33- )
28+ " Combinations Main" = teal.widgets :: ggplot2_args(labs = list (title = NULL ))
29+ ),
30+ pre_output = NULL ,
31+ post_output = NULL
3432 ),
33+ timeout = 3000 ,
3534 seed = 1
3635 )
3736}
3837
3938test_that(" e2e - tm_missing_data: Initializes without errors" , {
39+ testthat :: skip(" chromium" )
4040 skip_if_too_deep(5 )
4141 app_driver <- app_driver_tm_missing_data()
4242
4343 app_driver $ expect_no_shiny_error()
4444
45- testthat :: expect_equal(app_driver $ get_text(" .teal-modules-tree .active" ), " Missing data" )
45+ testthat :: expect_equal(
46+ app_driver $ get_text(" #teal-teal_modules-active_tab .active" ),
47+ " Missing data"
48+ )
49+
50+ encoding_dataset <- app_driver $ get_text(
51+ app_driver $ active_module_element(" dataset_encodings .help-block" )
52+ )
4653
47- encoding_dataset <- app_driver $ get_text(paste(app_driver $ namespaces(TRUE )$ wrapper(NULL ), " .help-block" ))
4854 testthat :: expect_match(encoding_dataset , " Datasets.*iris.*mtcars" , all = FALSE )
4955
5056
5157 app_driver $ stop()
5258})
5359
5460test_that(" e2e - tm_missing_data: Default settings and visibility of the summary graph" , {
61+ testthat :: skip(" chromium" )
5562 skip_if_too_deep(5 )
5663 app_driver <- app_driver_tm_missing_data()
5764 # default summary tab
@@ -65,22 +72,26 @@ test_that("e2e - tm_missing_data: Default settings and visibility of the summary
6572 c(" Petal.Length" , " Sepal.Length" , " Petal.Width" , " Species" , " Sepal.Width" )
6673 )
6774
68- app_driver $ click(selector = app_driver $ namespaces( TRUE ) $ module (" iris-filter_na" ))
75+ app_driver $ click(selector = app_driver $ active_module_element (" iris-filter_na" ))
6976 app_driver $ expect_no_validation_error()
7077
71- app_driver $ click(selector = app_driver $ namespaces( TRUE ) $ module (" iris-any_na" ))
78+ app_driver $ click(selector = app_driver $ active_module_element (" iris-any_na" ))
7279 app_driver $ expect_no_validation_error()
7380
7481 testthat :: expect_true(
7582 app_driver $ is_visible(
76- app_driver $ namespaces(TRUE )$ module(" iris-summary_plot-plot_out_main .shiny-plot-output" )
83+ sprintf(
84+ " %s .shiny-plot-output" ,
85+ app_driver $ active_module_element(" iris-summary_plot-plot_out_main" )
86+ )
7787 )
7888 )
7989
8090 app_driver $ stop()
8191})
8292
8393test_that(" e2e - tm_missing_data: Check default settings and visibility of the combinations graph and encodings" , {
94+ testthat :: skip(" chromium" )
8495 skip_if_too_deep(5 )
8596 app_driver <- app_driver_tm_missing_data()
8697
@@ -92,27 +103,33 @@ test_that("e2e - tm_missing_data: Check default settings and visibility of the c
92103 app_driver $ expect_no_validation_error()
93104 testthat :: expect_true(
94105 app_driver $ is_visible(
95- app_driver $ namespaces(TRUE )$ module(" iris-combination_plot-plot_out_main .shiny-plot-output" )
106+ sprintf(
107+ " %s .shiny-plot-output" ,
108+ app_driver $ active_module_element(" iris-combination_plot-plot_out_main" )
109+ )
96110 )
97111 )
98112
99113 # combination encoding
100114
101115 testthat :: expect_true(
102116 app_driver $ is_visible(
103- app_driver $ namespaces(TRUE )$ module(" iris-cutoff .shiny-input-container" )
117+ sprintf(
118+ " %s .shiny-input-container" ,
119+ app_driver $ active_module_element(" iris-cutoff" )
120+ )
104121 )
105122 )
106123
107- testthat :: expect_equal(app_driver $ get_active_module_input(" iris-combination_cutoff" ), 1L )
124+ testthat :: expect_equal(app_driver $ get_active_module_input(" iris-combination_cutoff" ), 2L )
108125 app_driver $ set_active_module_input(" iris-combination_cutoff" , 10L )
109- testthat :: expect_equal(app_driver $ get_active_module_input(" iris-combination_cutoff" ), 10L )
110126 app_driver $ expect_no_validation_error()
111127
112128 app_driver $ stop()
113129})
114130
115131test_that(" e2e - tm_missing_data: Validate functionality and UI response for 'By Variable Levels'" , {
132+ testthat :: skip(" chromium" )
116133 skip_if_too_deep(5 )
117134 app_driver <- app_driver_tm_missing_data()
118135 # By variable levels
@@ -137,17 +154,18 @@ test_that("e2e - tm_missing_data: Validate functionality and UI response for 'By
137154 " counts"
138155 )
139156 app_driver $ set_active_module_input(" iris-count_type" , " proportions" )
140- testthat :: expect_true(app_driver $ is_visible(app_driver $ namespaces( TRUE ) $ module (" iris-levels_table" )))
157+ testthat :: expect_true(app_driver $ is_visible(app_driver $ active_module_element (" iris-levels_table" )))
141158
142159 app_driver $ stop()
143160})
144161
145162test_that(" e2e - tm_missing_data: Validate 'By Variable Levels' table values" , {
163+ testthat :: skip(" chromium" )
146164 skip_if_too_deep(5 )
147165 app_driver <- app_driver_tm_missing_data()
148166
149167 app_driver $ set_active_module_input(" iris-summary_type" , " By Variable Levels" )
150- levels_table <- app_driver $ namespaces( TRUE ) $ module (" iris-levels_table" ) %> %
168+ levels_table <- app_driver $ active_module_element (" iris-levels_table" ) %> %
151169 app_driver $ get_html_rvest() %> %
152170 rvest :: html_table(fill = TRUE ) %> %
153171 . [[1 ]]
0 commit comments