record_test {shinytest2} | R Documentation |
Launch test event recorder for a Shiny app
Description
Once a recording is completed, it will create or append a new
shinytest2 test to the testthat test_file
.
Usage
record_test(
app = ".",
...,
name = NULL,
seed = NULL,
load_timeout = NULL,
shiny_args = list(),
test_file = "test-shinytest2.R",
open_test_file = rlang::is_interactive(),
allow_no_input_binding = NULL,
record_screen_size = TRUE,
run_test = TRUE
)
Arguments
app |
A |
... |
Must be empty. Allows for parameter expansion. |
name |
Name provided to |
seed |
A random seed to set before running the app. This seed will also be used in the test script. |
load_timeout |
Maximum time to wait for the Shiny application to load, in milliseconds. If a value is provided, it will be saved in the test script. |
shiny_args |
A list of options to pass to |
test_file |
Base file name of the testthat test file. |
open_test_file |
If |
allow_no_input_binding |
This value controls if events without input bindings are recorded.
See |
record_screen_size |
If |
run_test |
If |
Uploading files
Files that are uploaded to your Shiny app must be located somewhere within
the tests/testthat
subdirectory or available via system.file()
.
Files that are uploaded during recording that do not have a valid path will
have a warning inserted into the code. Please fix the file path by moving the
file to the tests/testthat
subdirectory or by using system.file()
. After
fixing the path, remove the line of warning code.
See Also
Examples
## Not run:
record_test("path/to/app")
## End(Not run)