File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ Suggests:
19
19
future,
20
20
httr,
21
21
knitr,
22
- shinytest ,
23
- testthat (>= 2 .0)
22
+ shinytest2 ,
23
+ testthat (>= 3 .0)
24
24
VignetteBuilder:
25
25
knitr
26
26
biocViews:
27
27
Encoding: UTF-8
28
28
Language: en-US
29
29
LazyData: true
30
30
Roxygen: list(markdown = TRUE)
31
- RoxygenNote: 7.3.1
31
+ RoxygenNote: 7.3.2
Original file line number Diff line number Diff line change 1
1
test_that(" The Shiny App returns a proper greeting" , {
2
- library(shinytest )
3
- app <- ShinyDriver $ new(
2
+ library(shinytest2 )
3
+ app <- AppDriver $ new(
4
4
" shiny-app/" ,
5
- loadTimeout = 1e5 ,
6
- debug = " all" ,
7
- phantomTimeout = 1e5 ,
5
+ load_timeout = 1e5 ,
6
+ timeout = 1e5 ,
8
7
seed = 123
9
8
)
10
- app $ getDebugLog ()
9
+ app $ get_logs ()
11
10
12
11
# Set input
13
- app $ setInputs(name = " john" )
14
- app $ setInputs(greet = " click" )
15
- output <- app $ getValue(name = " greeting" )
12
+ app $ set_inputs(name = " john" )
13
+ app $ click(" greet" )
16
14
17
- # test
15
+ # Get output
16
+ output <- app $ get_value(output = " greeting" )
17
+
18
+ # Assert
18
19
expect_equal(output , " Hello, John" )
19
20
20
- # wait for the process to close gracefully
21
- # this allows covr to write out the coverage results
22
- p <- app $ .__enclos_env__ $ private $ shinyProcess
23
- p $ interrupt()
24
- p $ wait()
21
+ # Stop the app
22
+ app $ stop()
25
23
})
You can’t perform that action at this time.
0 commit comments