Launch test event recorder for a Shiny appSource:
Once a recording is completed, it will create or append a new
shinytest2 test to the testthat
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 )
AppDriverobject, or path to a Shiny application.
Must be empty. Allows for parameter expansion.
Name provided to
AppDriver. This value should be unique between all tests within a test file. If it is not unique, different expect methods may overwrite each other.
A random seed to set before running the app. This seed will also be used in the test script.
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.
A list of options to pass to
runApp(). If a value is provided, it will be saved in the test script.
Base file name of the testthat test file.
TRUE, the test file will be opened in an editor via
This value controls if events without input bindings are recorded.
TRUE, events without input bindings are recorded.
FALSE, events without input bindings are not recorded.
NULL(default), if an updated input does not have a corresponding
input, a modal dialog will be shown asking if unbound input events should
$set_inputs()for more information.
TRUE, the screen size will be recorded when initialized and changed.
test_filewill be executed after saving the recording.
Files that are uploaded to your Shiny app must be located somewhere within
tests/testthat subdirectory or available via
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
fixing the path, remove the line of warning code.